Merge lp:~carlos-mazieri/ubuntu-filemanager-app/samba-improvements-07 into lp:ubuntu-filemanager-app

Proposed by Carlos Jose Mazieri
Status: Merged
Approved by: Arto Jalkanen
Approved revision: 480
Merged at revision: 491
Proposed branch: lp:~carlos-mazieri/ubuntu-filemanager-app/samba-improvements-07
Merge into: lp:ubuntu-filemanager-app
Prerequisite: lp:~carlos-mazieri/ubuntu-filemanager-app/samba-improvements-06
Diff against target: 36 lines (+12/-8)
1 file modified
src/plugin/folderlistmodel/smb/qsambaclient/src/smbutil.cpp (+12/-8)
To merge this branch: bzr merge lp:~carlos-mazieri/ubuntu-filemanager-app/samba-improvements-07
Reviewer Review Type Date Requested Status
Arto Jalkanen Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Jenkins Bot continuous-integration Needs Fixing
Review via email: mp+275832@code.launchpad.net

Commit message

improved SmbUtil::findSmBServer()

Description of the change

improved SmbUtil::findSmBServer()

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Arto Jalkanen (ajalkane) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/plugin/folderlistmodel/smb/qsambaclient/src/smbutil.cpp'
--- src/plugin/folderlistmodel/smb/qsambaclient/src/smbutil.cpp 2015-10-27 11:09:54 +0000
+++ src/plugin/folderlistmodel/smb/qsambaclient/src/smbutil.cpp 2015-10-27 11:09:54 +0000
@@ -716,21 +716,25 @@
716 */716 */
717QString SmbUtil::findSmBServer(const smbc_dirent & dirent)717QString SmbUtil::findSmBServer(const smbc_dirent & dirent)
718{718{
719 QString host("localhost");719 QString host;
720 if (dirent.name[0] != 0)720 if (dirent.name[0] != 0)
721 {721 {
722 QString name(dirent.name);722 QString name(dirent.name);
723 host = name;723 host = name;
724 QString comment(dirent.comment);724 }
725 if (!comment.isEmpty())725 QString comment(dirent.comment);
726 if (!comment.isEmpty())
727 {
728 QString fullName = comment.split(QLatin1Char(' '), QString::SkipEmptyParts).first();
729 if (!fullName.isEmpty())
726 {730 {
727 QString fullName = comment.split(QLatin1Char(' '), QString::SkipEmptyParts).first();731 host = fullName;
728 if (!fullName.isEmpty() && fullName.startsWith(name), Qt::CaseSensitive)
729 {
730 host = fullName;
731 }
732 }732 }
733 }733 }
734 if (host.isEmpty())
735 {
736 host = QLatin1String("localhost");
737 }
734 return host.toLower();738 return host.toLower();
735}739}
736740

Subscribers

People subscribed via source and target branches