Merge lp:~carlos-mazieri/ubuntu-filemanager-app/samba-hostname-bug into lp:ubuntu-filemanager-app

Proposed by Carlos Jose Mazieri on 2015-11-08
Status: Merged
Approved by: Arto Jalkanen on 2015-11-10
Approved revision: 499
Merged at revision: 500
Proposed branch: lp:~carlos-mazieri/ubuntu-filemanager-app/samba-hostname-bug
Merge into: lp:ubuntu-filemanager-app
Diff against target: 39 lines (+13/-7)
1 file modified
src/plugin/folderlistmodel/smb/qsambaclient/src/smbutil.cpp (+13/-7)
To merge this branch: bzr merge lp:~carlos-mazieri/ubuntu-filemanager-app/samba-hostname-bug
Reviewer Review Type Date Requested Status
Arto Jalkanen 2015-11-08 Approve on 2015-11-10
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-11-08
Jenkins Bot continuous-integration Approve on 2015-11-08
Review via email: mp+276932@code.launchpad.net

Commit message

Fixed a bug #1508504 related to get the Samba hostname.
It used to get the description instead of the name.
For some cases the name is the first word in the description, so it worked in some cases.

Description of the change

Fixed a bug #1508504 related to get the Samba hostname.
It used to get the description instead of the name.
For some cases the name is the first word in the description, so it worked in some cases.

To post a comment you must log in.
review: Approve (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-11-02 20:30:00 +0000
3+++ src/plugin/folderlistmodel/smb/qsambaclient/src/smbutil.cpp 2015-11-08 12:30:55 +0000
4@@ -363,8 +363,11 @@
5 }
6 else if (errno != EACCES && errno != ECONNREFUSED && slashes >= URL_SLASHES_NUMBER_FOR_SHARES) // perhaps is a file
7 {
8- errno = 0;
9- ret = static_cast<SmbUtil::StatReturn> (getStat(context, smb_path,st));
10+ errno = 0;
11+ if (getStat(context,smb_path,st) == 0)
12+ {
13+ ret = StatDone;
14+ }
15 }
16
17 if (errno != 0)
18@@ -722,13 +725,16 @@
19 QString name(dirent.name);
20 host = name;
21 }
22- QString comment(dirent.comment);
23- if (!comment.isEmpty())
24+ if (host.isEmpty())
25 {
26- QString fullName = comment.split(QLatin1Char(' '), QString::SkipEmptyParts).first();
27- if (!fullName.isEmpty())
28+ QString comment(dirent.comment);
29+ if (!comment.isEmpty())
30 {
31- host = fullName;
32+ QString fullName = comment.split(QLatin1Char(' '), QString::SkipEmptyParts).first();
33+ if (!fullName.isEmpty())
34+ {
35+ host = fullName;
36+ }
37 }
38 }
39 if (host.isEmpty())

Subscribers

People subscribed via source and target branches