Merge lp:~carlos-mazieri/ubuntu-filemanager-app/new-protocols-support-01 into lp:ubuntu-filemanager-app

Proposed by Carlos Jose Mazieri on 2015-12-12
Status: Merged
Approved by: Nicholas Skaggs on 2016-01-14
Approved revision: 511
Merged at revision: 514
Proposed branch: lp:~carlos-mazieri/ubuntu-filemanager-app/new-protocols-support-01
Merge into: lp:ubuntu-filemanager-app
Diff against target: 163 lines (+44/-25)
5 files modified
src/plugin/folderlistmodel/diriteminfo.cpp (+17/-3)
src/plugin/folderlistmodel/diriteminfo.h (+3/-1)
src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.cpp (+9/-8)
src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.h (+2/-2)
src/plugin/folderlistmodel/urliteminfo.cpp (+13/-11)
To merge this branch: bzr merge lp:~carlos-mazieri/ubuntu-filemanager-app/new-protocols-support-01
Reviewer Review Type Date Requested Status
Jenkins Bot continuous-integration Approve on 2016-01-14
Arto Jalkanen 2015-12-12 Approve on 2016-01-10
Review via email: mp+280387@code.launchpad.net

Commit message

Improved DirItemInfo and descendant classes:
* added DirItemInfo::setFile(const QString& newUrl) to change the current Item information
* fixed operator =

Description of the change

This MP is compound of 5 parts.

Summary:
 Reduces the complexity to add support to new protocols in the File Manager.
 Improves the current Samba browsing by moving it into the secondary thread which makes it a little faster.

To post a comment you must log in.
review: Approve (continuous-integration)
Arto Jalkanen (ajalkane) :
review: Approve

FAILED: Autolanding.
More details in the following jenkins job:
https://core-apps-jenkins.ubuntu.com/job/run-ap-tests-autolanding/9/
Executed test runs:
    None: https://core-apps-jenkins.ubuntu.com/job/generic-land-mp/1409/console

review: Needs Fixing (continuous-integration)

FAILED: Autolanding.
More details in the following jenkins job:
https://core-apps-jenkins.ubuntu.com/job/run-ap-tests-autolanding/23/
Executed test runs:
    None: https://core-apps-jenkins.ubuntu.com/job/generic-land-mp/1423/console

review: Needs Fixing (continuous-integration)

FAILED: Autolanding.
More details in the following jenkins job:
https://core-apps-jenkins.ubuntu.com/job/run-ap-tests-autolanding/24/
Executed test runs:
    None: https://core-apps-jenkins.ubuntu.com/job/generic-land-mp/1424/console

review: Needs Fixing (continuous-integration)

FAILED: Autolanding.
More details in the following jenkins job:
https://core-apps-jenkins.ubuntu.com/job/run-ap-tests-autolanding/25/
Executed test runs:
    None: https://core-apps-jenkins.ubuntu.com/job/generic-land-mp/1425/console

review: Needs Fixing (continuous-integration)

FAILED: Autolanding.
More details in the following jenkins job:
https://core-apps-jenkins.ubuntu.com/job/run-ap-tests-autolanding/38/
Executed test runs:
    None: https://core-apps-jenkins.ubuntu.com/job/generic-land-mp/1441/console

review: Needs Fixing (continuous-integration)
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/plugin/folderlistmodel/diriteminfo.cpp'
--- src/plugin/folderlistmodel/diriteminfo.cpp 2015-09-20 20:44:29 +0000
+++ src/plugin/folderlistmodel/diriteminfo.cpp 2015-12-12 15:40:26 +0000
@@ -71,9 +71,9 @@
71 ,_isExecutable(other._isExecutable)71 ,_isExecutable(other._isExecutable)
72 ,_isLocalSharedDir(other._isLocalSharedDir)72 ,_isLocalSharedDir(other._isLocalSharedDir)
73 ,_isHost(other._isHost)73 ,_isHost(other._isHost)
74 ,_isWorkGroup(false)74 ,_isWorkGroup(other._isWorkGroup)
75 ,_isNetworkShare(false)75 ,_isNetworkShare(other._isNetworkShare)
76 ,_needsAuthentication(false)76 ,_needsAuthentication(other._needsAuthentication)
77 ,_permissions(other._permissions)77 ,_permissions(other._permissions)
78 ,_size(other._size)78 ,_size(other._size)
79 ,_created(other._created)79 ,_created(other._created)
@@ -82,6 +82,7 @@
82 ,_path(other._path)82 ,_path(other._path)
83 ,_fileName(other._fileName) 83 ,_fileName(other._fileName)
84 ,_normalizedPath(other._normalizedPath)84 ,_normalizedPath(other._normalizedPath)
85 ,_authenticationPath(other._authenticationPath)
85{86{
8687
87}88}
@@ -107,6 +108,7 @@
107 ,_isNetworkShare(false)108 ,_isNetworkShare(false)
108 ,_needsAuthentication(false)109 ,_needsAuthentication(false)
109 ,_permissions(0)110 ,_permissions(0)
111 ,_size(0)
110{112{
111 setFileInfo(fi);113 setFileInfo(fi);
112}114}
@@ -326,6 +328,13 @@
326 d_ptr->setFileInfo(f);328 d_ptr->setFileInfo(f);
327}329}
328330
331void DirItemInfo::setFile(const QString &fullname)
332{
333 QFileInfo f;
334 f.setFile(fullname);
335 d_ptr->setFileInfo(f);
336}
337
329QFileInfo DirItemInfo::diskFileInfo() const338QFileInfo DirItemInfo::diskFileInfo() const
330{339{
331 QFileInfo fi(absoluteFilePath());340 QFileInfo fi(absoluteFilePath());
@@ -588,3 +597,8 @@
588 d_ptr->_isReadable = true;597 d_ptr->_isReadable = true;
589 d_ptr->_isExecutable = true;598 d_ptr->_isExecutable = true;
590}599}
600
601void DirItemInfo::setAsShare()
602{
603 d_ptr->_isNetworkShare = true;
604}
591605
=== modified file 'src/plugin/folderlistmodel/diriteminfo.h'
--- src/plugin/folderlistmodel/diriteminfo.h 2015-09-13 14:20:30 +0000
+++ src/plugin/folderlistmodel/diriteminfo.h 2015-12-12 15:40:26 +0000
@@ -108,10 +108,12 @@
108 virtual bool isBrowsable() const;108 virtual bool isBrowsable() const;
109 virtual bool needsAuthentication() const;109 virtual bool needsAuthentication() const;
110 virtual QString authenticationPath() const;110 virtual QString authenticationPath() const;
111 virtual void setFile(const QString &dir, const QString & file); 111 virtual void setFile(const QString &dir, const QString & file);
112 virtual void setFile(const QString &fullname);
112 virtual bool permission(QFile::Permissions permissions) const;113 virtual bool permission(QFile::Permissions permissions) const;
113 void fillFromStatBuf(const struct stat& statBuffer);114 void fillFromStatBuf(const struct stat& statBuffer);
114 void setAsHost();115 void setAsHost();
116 void setAsShare();
115117
116public:118public:
117 static QString removeExtraSlashes(const QString &url, int firstSlashIndex = -1);119 static QString removeExtraSlashes(const QString &url, int firstSlashIndex = -1);
118120
=== modified file 'src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.cpp'
--- src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.cpp 2015-10-03 15:28:25 +0000
+++ src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.cpp 2015-12-12 15:40:26 +0000
@@ -136,21 +136,22 @@
136 url.setPath(f.canonicalFilePath());136 url.setPath(f.canonicalFilePath());
137 smb_path = url.toString();137 smb_path = url.toString();
138 }138 }
139 smb_path += QDir::separator() + file;139 if (!file.isEmpty())
140 {
141 smb_path += QDir::separator() + file;
142 }
140 SmbItemInfo *other = new SmbItemInfo( LocationUrl::SmbURL + DirItemInfo::removeExtraSlashes(smb_path),143 SmbItemInfo *other = new SmbItemInfo( LocationUrl::SmbURL + DirItemInfo::removeExtraSlashes(smb_path),
141 m_smb);144 m_smb);
142 if (other->isValid())145 if (other->isValid())
143 {146 {
144 *this = *other;147 *this = *other;
145 }148 }
146 else149
147 {150 delete other; //always delete
148 delete other;
149 }
150}151}
151152
152153void SmbItemInfo::setFile(const QString &smb_path)
153void SmbItemInfo::setAsShare()
154{154{
155 d_ptr->_isNetworkShare = true;155 return setFile(smb_path, QLatin1String(0));
156}156}
157
157158
=== modified file 'src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.h'
--- src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.h 2015-09-13 14:20:30 +0000
+++ src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.h 2015-12-12 15:40:26 +0000
@@ -40,9 +40,9 @@
40 ~SmbItemInfo();40 ~SmbItemInfo();
4141
42public:42public:
43 QString sharePath() const;43 QString sharePath() const;
44 void setAsShare();
45 virtual void setFile(const QString &dir, const QString & file);44 virtual void setFile(const QString &dir, const QString & file);
45 virtual void setFile(const QString &smb_path);
4646
47protected: 47protected:
48 void setInfo(const QString &smb_path);48 void setInfo(const QString &smb_path);
4949
=== modified file 'src/plugin/folderlistmodel/urliteminfo.cpp'
--- src/plugin/folderlistmodel/urliteminfo.cpp 2015-09-07 20:32:36 +0000
+++ src/plugin/folderlistmodel/urliteminfo.cpp 2015-12-12 15:40:26 +0000
@@ -31,23 +31,25 @@
31UrlItemInfo::UrlItemInfo(const QString& urlPath, const QString& urlRoot):31UrlItemInfo::UrlItemInfo(const QString& urlPath, const QString& urlRoot):
32 DirItemInfo()32 DirItemInfo()
33{33{
34 if (urlPath == urlRoot)34 if (!urlPath.isEmpty())
35 {35 {
36 setRoot(urlPath);36 if (urlPath == urlRoot)
37 }
38 else
39 {
40 if (!urlPath.startsWith(urlRoot))
41 {37 {
42 d_ptr->_isValid = false;38 setRoot(urlPath);
43 d_ptr->_isAbsolute = false;
44 }39 }
45 else40 else
46 {41 {
47 init(urlPath);42 if (!urlPath.startsWith(urlRoot))
43 {
44 d_ptr->_isValid = false;
45 d_ptr->_isAbsolute = false;
46 }
47 else
48 {
49 init(urlPath);
50 }
48 }51 }
49 }52 }
50
51}53}
5254
5355

Subscribers

People subscribed via source and target branches