← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~carlos-mazieri/ubuntu-filemanager-app/samba-ui-04 into lp:ubuntu-filemanager-app

 

Carlos Jose Mazieri has proposed merging lp:~carlos-mazieri/ubuntu-filemanager-app/samba-ui-04 into lp:ubuntu-filemanager-app with lp:~carlos-mazieri/ubuntu-filemanager-app/samba-ui-03 as a prerequisite.

Commit message:
forcing Executable/Readable for hosts, it will make them act as folder when they do not have access (needs authentication)

Requested reviews:
  Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot): continuous-integration
  Ubuntu File Manager Developers (ubuntu-filemanager-dev)

For more details, see:
https://code.launchpad.net/~carlos-mazieri/ubuntu-filemanager-app/samba-ui-04/+merge/270338

forcing hosts to be visible even they require authentication
-- 
Your team Ubuntu File Manager Developers is requested to review the proposed merge of lp:~carlos-mazieri/ubuntu-filemanager-app/samba-ui-04 into lp:ubuntu-filemanager-app.
=== modified file 'src/plugin/folderlistmodel/diriteminfo.cpp'
--- src/plugin/folderlistmodel/diriteminfo.cpp	2015-07-11 21:21:16 +0000
+++ src/plugin/folderlistmodel/diriteminfo.cpp	2015-09-07 21:32:15 +0000
@@ -579,3 +579,12 @@
     }
     return ret;
 }
+
+
+void DirItemInfo::setAsHost()
+{
+    d_ptr->_isHost = true;
+    d_ptr->_exists = true;
+    d_ptr->_isReadable   = true;
+    d_ptr->_isExecutable = true;
+}

=== modified file 'src/plugin/folderlistmodel/diriteminfo.h'
--- src/plugin/folderlistmodel/diriteminfo.h	2015-02-22 20:59:32 +0000
+++ src/plugin/folderlistmodel/diriteminfo.h	2015-09-07 21:32:15 +0000
@@ -111,6 +111,7 @@
     virtual void      setFile(const QString &dir, const QString & file);    
     virtual bool      permission(QFile::Permissions permissions) const;
     void              fillFromStatBuf(const struct stat& statBuffer);
+    void              setAsHost();
 
 public:
     static QString    removeExtraSlashes(const QString &url, int firstSlashIndex = -1);

=== modified file 'src/plugin/folderlistmodel/smb/smblistworker.cpp'
--- src/plugin/folderlistmodel/smb/smblistworker.cpp	2015-05-20 16:18:07 +0000
+++ src/plugin/folderlistmodel/smb/smblistworker.cpp	2015-09-07 21:32:15 +0000
@@ -25,11 +25,11 @@
 SmbListWorker::SmbListWorker(const QString &pathName,
                              QDir::Filter filter,
                              const bool isRecursive,
-                             bool parentIsHost,
+                             DirItemInfo * parentItem,
                              Const_SmbUtil_Ptr smb)
    : DirListWorker(pathName, filter, isRecursive)  
    , SmbObject(pathName, smb)
-   , m_parentIsHost(parentIsHost)
+   , m_parent(parentItem)
 {
     mLoaderType =  NetworkLoader;
 }
@@ -51,9 +51,14 @@
     {
         QString next = dir.next();
         SmbItemInfo item (next, m_smb);
-        if (m_parentIsHost)
+        if (m_parent)
         {
-            item.setAsShare();
+            if (m_parent->isHost()) {
+                item.setAsShare();
+            }
+            else if (m_parent->isWorkGroup()) {
+                 item.setAsHost();
+            }
         }
         smbContent.append(item);
     }

=== modified file 'src/plugin/folderlistmodel/smb/smblistworker.h'
--- src/plugin/folderlistmodel/smb/smblistworker.h	2015-05-20 16:18:07 +0000
+++ src/plugin/folderlistmodel/smb/smblistworker.h	2015-09-07 21:32:15 +0000
@@ -29,12 +29,12 @@
 {
     Q_OBJECT
 public:
-    explicit SmbListWorker(const QString &pathName, QDir::Filter filter, const bool isRecursive, bool parentIsHost, Const_SmbUtil_Ptr smb);
+    explicit SmbListWorker(const QString &pathName, QDir::Filter filter, const bool isRecursive, DirItemInfo * parentItem, Const_SmbUtil_Ptr smb);
 
 private:
     DirItemInfoList getNetworkContent();
 private:
-    bool               m_parentIsHost;
+    DirItemInfo    * m_parent;
 };
 
 #endif // SMBLISTWORKER_H

=== modified file 'src/plugin/folderlistmodel/smb/smblocation.cpp'
--- src/plugin/folderlistmodel/smb/smblocation.cpp	2015-07-15 17:42:37 +0000
+++ src/plugin/folderlistmodel/smb/smblocation.cpp	2015-09-07 21:32:15 +0000
@@ -88,7 +88,7 @@
 
 DirListWorker * SmbLocation::newListWorker(const QString &urlPath, QDir::Filter filter, const bool isRecursive)
 {
-    return new SmbListWorker(urlPath,filter,isRecursive, m_info ? m_info->isHost() : false, m_smb);
+    return new SmbListWorker(urlPath,filter,isRecursive, m_info, m_smb);
 }
 
 

=== modified file 'src/plugin/folderlistmodel/urliteminfo.cpp'
--- src/plugin/folderlistmodel/urliteminfo.cpp	2015-03-14 17:38:50 +0000
+++ src/plugin/folderlistmodel/urliteminfo.cpp	2015-09-07 21:32:15 +0000
@@ -105,11 +105,7 @@
         if (url.path().isEmpty())
         {
             //!< initial set is "host", Samba shares also have Workspace which will be handled in \ref SmbItemInfo
-            d_ptr->_isHost = true;
-            //set as it exists so far
-            d_ptr->_exists = true;
-            d_ptr->_isReadable   = true;
-            d_ptr->_isExecutable = true;
+           setAsHost();
         }
     }
 }