SVN commit 1357415 by areinholdt: Improved searching for known shares. Now the list of mounted shares is also taken into account. M +36 -2 smb4kbookmarkhandler.cpp --- trunk/playground/network/smb4k/core/smb4kbookmarkhandler.cpp #1357414:1357415 @@ -113,13 +113,15 @@ void Smb4KBookmarkHandler::addBookmark( const QUrl & url ) { + QList shares; + + // First, search the list of shares gathered by + // the scanner. for ( int i = 0; i < sharesList().size(); ++i ) { if ( sharesList().at( i )->url() == url ) { - QList shares; shares << sharesList().at( i ); - addBookmarks( shares, 0 ); break; } else @@ -127,9 +129,41 @@ continue; } } + + // Second, if the list is still empty, try the list + // of mounted shares. + if ( shares.isEmpty() ) + { + for ( int i = 0; i < mountedSharesList().size(); ++i ) + { + if ( mountedSharesList().at( i )->url() == url ) + { + shares << mountedSharesList().at( i ); + break; } + else + { + continue; + } + } + } + else + { + // Do nothing + } + // Now add the share. + if ( !shares.isEmpty() ) + { + addBookmarks( shares, 0 ); + } + else + { + // Do nothing + } +} + void Smb4KBookmarkHandler::addBookmarks( const QList &list, QWidget *parent ) { // Prepare the list of bookmarks and show the save dialog.