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

Proposed by Carlos Jose Mazieri on 2015-09-07
Status: Merged
Approved by: Arto Jalkanen on 2015-09-08
Approved revision: 462
Merged at revision: 469
Proposed branch: lp:~carlos-mazieri/ubuntu-filemanager-app/samba-ui-04
Merge into: lp:ubuntu-filemanager-app
Prerequisite: lp:~carlos-mazieri/ubuntu-filemanager-app/samba-ui-03
Diff against target: 112 lines (+23/-12)
6 files modified
src/plugin/folderlistmodel/diriteminfo.cpp (+9/-0)
src/plugin/folderlistmodel/diriteminfo.h (+1/-0)
src/plugin/folderlistmodel/smb/smblistworker.cpp (+9/-4)
src/plugin/folderlistmodel/smb/smblistworker.h (+2/-2)
src/plugin/folderlistmodel/smb/smblocation.cpp (+1/-1)
src/plugin/folderlistmodel/urliteminfo.cpp (+1/-5)
To merge this branch: bzr merge lp:~carlos-mazieri/ubuntu-filemanager-app/samba-ui-04
Reviewer Review Type Date Requested Status
Arto Jalkanen 2015-09-07 Approve on 2015-09-08
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-09-07
Review via email: mp+270338@code.launchpad.net

Commit message

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

Description of the change

forcing hosts to be visible even they require authentication

To post a comment you must log in.
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/diriteminfo.cpp'
2--- src/plugin/folderlistmodel/diriteminfo.cpp 2015-07-11 21:21:16 +0000
3+++ src/plugin/folderlistmodel/diriteminfo.cpp 2015-09-07 21:32:15 +0000
4@@ -579,3 +579,12 @@
5 }
6 return ret;
7 }
8+
9+
10+void DirItemInfo::setAsHost()
11+{
12+ d_ptr->_isHost = true;
13+ d_ptr->_exists = true;
14+ d_ptr->_isReadable = true;
15+ d_ptr->_isExecutable = true;
16+}
17
18=== modified file 'src/plugin/folderlistmodel/diriteminfo.h'
19--- src/plugin/folderlistmodel/diriteminfo.h 2015-02-22 20:59:32 +0000
20+++ src/plugin/folderlistmodel/diriteminfo.h 2015-09-07 21:32:15 +0000
21@@ -111,6 +111,7 @@
22 virtual void setFile(const QString &dir, const QString & file);
23 virtual bool permission(QFile::Permissions permissions) const;
24 void fillFromStatBuf(const struct stat& statBuffer);
25+ void setAsHost();
26
27 public:
28 static QString removeExtraSlashes(const QString &url, int firstSlashIndex = -1);
29
30=== modified file 'src/plugin/folderlistmodel/smb/smblistworker.cpp'
31--- src/plugin/folderlistmodel/smb/smblistworker.cpp 2015-05-20 16:18:07 +0000
32+++ src/plugin/folderlistmodel/smb/smblistworker.cpp 2015-09-07 21:32:15 +0000
33@@ -25,11 +25,11 @@
34 SmbListWorker::SmbListWorker(const QString &pathName,
35 QDir::Filter filter,
36 const bool isRecursive,
37- bool parentIsHost,
38+ DirItemInfo * parentItem,
39 Const_SmbUtil_Ptr smb)
40 : DirListWorker(pathName, filter, isRecursive)
41 , SmbObject(pathName, smb)
42- , m_parentIsHost(parentIsHost)
43+ , m_parent(parentItem)
44 {
45 mLoaderType = NetworkLoader;
46 }
47@@ -51,9 +51,14 @@
48 {
49 QString next = dir.next();
50 SmbItemInfo item (next, m_smb);
51- if (m_parentIsHost)
52+ if (m_parent)
53 {
54- item.setAsShare();
55+ if (m_parent->isHost()) {
56+ item.setAsShare();
57+ }
58+ else if (m_parent->isWorkGroup()) {
59+ item.setAsHost();
60+ }
61 }
62 smbContent.append(item);
63 }
64
65=== modified file 'src/plugin/folderlistmodel/smb/smblistworker.h'
66--- src/plugin/folderlistmodel/smb/smblistworker.h 2015-05-20 16:18:07 +0000
67+++ src/plugin/folderlistmodel/smb/smblistworker.h 2015-09-07 21:32:15 +0000
68@@ -29,12 +29,12 @@
69 {
70 Q_OBJECT
71 public:
72- explicit SmbListWorker(const QString &pathName, QDir::Filter filter, const bool isRecursive, bool parentIsHost, Const_SmbUtil_Ptr smb);
73+ explicit SmbListWorker(const QString &pathName, QDir::Filter filter, const bool isRecursive, DirItemInfo * parentItem, Const_SmbUtil_Ptr smb);
74
75 private:
76 DirItemInfoList getNetworkContent();
77 private:
78- bool m_parentIsHost;
79+ DirItemInfo * m_parent;
80 };
81
82 #endif // SMBLISTWORKER_H
83
84=== modified file 'src/plugin/folderlistmodel/smb/smblocation.cpp'
85--- src/plugin/folderlistmodel/smb/smblocation.cpp 2015-07-15 17:42:37 +0000
86+++ src/plugin/folderlistmodel/smb/smblocation.cpp 2015-09-07 21:32:15 +0000
87@@ -88,7 +88,7 @@
88
89 DirListWorker * SmbLocation::newListWorker(const QString &urlPath, QDir::Filter filter, const bool isRecursive)
90 {
91- return new SmbListWorker(urlPath,filter,isRecursive, m_info ? m_info->isHost() : false, m_smb);
92+ return new SmbListWorker(urlPath,filter,isRecursive, m_info, m_smb);
93 }
94
95
96
97=== modified file 'src/plugin/folderlistmodel/urliteminfo.cpp'
98--- src/plugin/folderlistmodel/urliteminfo.cpp 2015-03-14 17:38:50 +0000
99+++ src/plugin/folderlistmodel/urliteminfo.cpp 2015-09-07 21:32:15 +0000
100@@ -105,11 +105,7 @@
101 if (url.path().isEmpty())
102 {
103 //!< initial set is "host", Samba shares also have Workspace which will be handled in \ref SmbItemInfo
104- d_ptr->_isHost = true;
105- //set as it exists so far
106- d_ptr->_exists = true;
107- d_ptr->_isReadable = true;
108- d_ptr->_isExecutable = true;
109+ setAsHost();
110 }
111 }
112 }

Subscribers

People subscribed via source and target branches