Skip to content

Commit

Permalink
changed: Refactor CGUIMediaWindow::ShowShareErrorMessage() so it work…
Browse files Browse the repository at this point in the history
…s with any path
  • Loading branch information
arnova committed Dec 28, 2012
1 parent 84fe311 commit 101c683
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions xbmc/windows/GUIMediaWindow.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1188,21 +1188,18 @@ bool CGUIMediaWindow::HaveDiscOrConnection(const CStdString& strPath, int iDrive
// \brief Shows a standard errormessage for a given pItem. // \brief Shows a standard errormessage for a given pItem.
void CGUIMediaWindow::ShowShareErrorMessage(CFileItem* pItem) void CGUIMediaWindow::ShowShareErrorMessage(CFileItem* pItem)
{ {
if (pItem->m_bIsShareOrDrive) int idMessageText = 0;
{ CURL url(pItem->GetPath());
int idMessageText=0; const CStdString& strHostName = url.GetHostName();
const CURL& url=pItem->GetAsUrl();
const CStdString& strHostName=url.GetHostName(); if (url.GetProtocol() == "smb" && strHostName.IsEmpty()) // smb workgroup

idMessageText = 15303; // Workgroup not found
if (pItem->m_iDriveType != CMediaSource::SOURCE_TYPE_REMOTE) // Local shares incl. dvd drive else if (pItem->m_iDriveType == CMediaSource::SOURCE_TYPE_REMOTE || URIUtils::IsRemote(pItem->GetPath()))
idMessageText=15300; idMessageText = 15301; // Could not connect to network server
else if (url.GetProtocol() == "smb" && strHostName.IsEmpty()) // smb workgroup else
idMessageText=15303; idMessageText = 15300; // Path not found or invalid
else // All other remote shares
idMessageText=15301; CGUIDialogOK::ShowAndGetInput(220, idMessageText, 0, 0);

CGUIDialogOK::ShowAndGetInput(220, idMessageText, 0, 0);
}
} }


// \brief The functon goes up one level in the directory tree // \brief The functon goes up one level in the directory tree
Expand Down

0 comments on commit 101c683

Please sign in to comment.