← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

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

 

Carlos Jose Mazieri has proposed merging lp:~carlos-mazieri/ubuntu-filemanager-app/samba-hostname-bug into lp:ubuntu-filemanager-app.

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.

Requested reviews:
  Ubuntu File Manager Developers (ubuntu-filemanager-dev)

For more details, see:
https://code.launchpad.net/~carlos-mazieri/ubuntu-filemanager-app/samba-hostname-bug/+merge/276932

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.
-- 
Your team Ubuntu File Manager Developers is requested to review the proposed merge of lp:~carlos-mazieri/ubuntu-filemanager-app/samba-hostname-bug into lp:ubuntu-filemanager-app.
=== modified file 'src/plugin/folderlistmodel/smb/qsambaclient/src/smbutil.cpp'
--- src/plugin/folderlistmodel/smb/qsambaclient/src/smbutil.cpp	2015-11-02 20:30:00 +0000
+++ src/plugin/folderlistmodel/smb/qsambaclient/src/smbutil.cpp	2015-11-08 12:30:55 +0000
@@ -363,8 +363,11 @@
     }
     else if (errno != EACCES && errno != ECONNREFUSED && slashes >= URL_SLASHES_NUMBER_FOR_SHARES) // perhaps is a file
     {
-        errno = 0;
-        ret = static_cast<SmbUtil::StatReturn> (getStat(context, smb_path,st));
+        errno = 0;        
+        if (getStat(context,smb_path,st) == 0)
+        {
+            ret = StatDone;
+        }
     }
 
     if (errno != 0)
@@ -722,13 +725,16 @@
         QString name(dirent.name);
         host = name;
     }
-    QString comment(dirent.comment);
-    if (!comment.isEmpty())
+    if (host.isEmpty())
     {
-        QString fullName = comment.split(QLatin1Char(' '), QString::SkipEmptyParts).first();
-        if (!fullName.isEmpty())
+        QString comment(dirent.comment);
+        if (!comment.isEmpty())
         {
-            host = fullName;
+            QString fullName = comment.split(QLatin1Char(' '), QString::SkipEmptyParts).first();
+            if (!fullName.isEmpty())
+            {
+                host = fullName;
+            }
         }
     }
     if (host.isEmpty())


Follow ups