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

Proposed by Carlos Jose Mazieri on 2015-10-27
Status: Merged
Approved by: Arto Jalkanen on 2015-10-27
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 2015-10-27 Approve on 2015-10-27
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-10-27
Jenkins Bot continuous-integration Needs Fixing on 2015-10-27
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.
review: Needs Fixing (continuous-integration)
review: Approve (continuous-integration)
Arto Jalkanen (ajalkane) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/plugin/folderlistmodel/smb/qsambaclient/src/smbutil.cpp'
2--- src/plugin/folderlistmodel/smb/qsambaclient/src/smbutil.cpp 2015-10-27 11:09:54 +0000
3+++ src/plugin/folderlistmodel/smb/qsambaclient/src/smbutil.cpp 2015-10-27 11:09:54 +0000
4@@ -716,21 +716,25 @@
5 */
6 QString SmbUtil::findSmBServer(const smbc_dirent & dirent)
7 {
8- QString host("localhost");
9+ QString host;
10 if (dirent.name[0] != 0)
11 {
12 QString name(dirent.name);
13 host = name;
14- QString comment(dirent.comment);
15- if (!comment.isEmpty())
16+ }
17+ QString comment(dirent.comment);
18+ if (!comment.isEmpty())
19+ {
20+ QString fullName = comment.split(QLatin1Char(' '), QString::SkipEmptyParts).first();
21+ if (!fullName.isEmpty())
22 {
23- QString fullName = comment.split(QLatin1Char(' '), QString::SkipEmptyParts).first();
24- if (!fullName.isEmpty() && fullName.startsWith(name), Qt::CaseSensitive)
25- {
26- host = fullName;
27- }
28+ host = fullName;
29 }
30 }
31+ if (host.isEmpty())
32+ {
33+ host = QLatin1String("localhost");
34+ }
35 return host.toLower();
36 }
37

Subscribers

People subscribed via source and target branches