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

Proposed by Carlos Jose Mazieri on 2015-09-19
Status: Merged
Approved by: Arto Jalkanen on 2015-09-20
Approved revision: 466
Merged at revision: 471
Proposed branch: lp:~carlos-mazieri/ubuntu-filemanager-app/samba-ui-06
Merge into: lp:ubuntu-filemanager-app
Prerequisite: lp:~carlos-mazieri/ubuntu-filemanager-app/samba-ui-05
Diff against target: 122 lines (+36/-18)
5 files modified
src/plugin/folderlistmodel/diriteminfo.cpp (+1/-1)
src/plugin/folderlistmodel/diriteminfo.h (+1/-0)
src/plugin/folderlistmodel/dirmodel.cpp (+28/-7)
src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.cpp (+5/-8)
src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.h (+1/-2)
To merge this branch: bzr merge lp:~carlos-mazieri/ubuntu-filemanager-app/samba-ui-06
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-09-19
Ubuntu File Manager Developers 2015-09-19 Pending
Review via email: mp+271738@code.launchpad.net

Commit message

Fixed problems in the Authentication and using saved Password

Description of the change

Fixed problems in the Authentication and using saved Password

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

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-09-19 16:16:16 +0000
3+++ src/plugin/folderlistmodel/diriteminfo.cpp 2015-09-19 16:16:16 +0000
4@@ -407,7 +407,7 @@
5
6 QString DirItemInfo::authenticationPath() const
7 {
8- return QLatin1String(0);
9+ return d_ptr->_authenticationPath;
10 }
11
12
13
14=== modified file 'src/plugin/folderlistmodel/diriteminfo.h'
15--- src/plugin/folderlistmodel/diriteminfo.h 2015-09-19 16:16:16 +0000
16+++ src/plugin/folderlistmodel/diriteminfo.h 2015-09-19 16:16:16 +0000
17@@ -176,6 +176,7 @@
18 QString _path;
19 QString _fileName;
20 QString _normalizedPath;
21+ QString _authenticationPath;
22
23 static QMimeDatabase mimeDatabase;
24 };
25
26=== modified file 'src/plugin/folderlistmodel/dirmodel.cpp'
27--- src/plugin/folderlistmodel/dirmodel.cpp 2015-09-19 16:16:16 +0000
28+++ src/plugin/folderlistmodel/dirmodel.cpp 2015-09-19 16:16:16 +0000
29@@ -978,11 +978,24 @@
30 bool DirModel::cdIntoItem(const DirItemInfo &fi)
31 {
32 bool ret = false;
33+ const DirItemInfo *item = &fi;
34+ DirItemInfo *created_itemInfo = 0;
35 if (fi.isBrowsable())
36- {
37- bool authentication = fi.needsAuthentication() &&
38- !mCurLocation->useAuthenticationDataIfExists(fi);
39- if (authentication)
40+ {
41+ bool needs_authentication = fi.needsAuthentication();
42+ if (needs_authentication)
43+ {
44+ if (mCurLocation->useAuthenticationDataIfExists(fi))
45+ {
46+ //there is a password stored to try
47+ created_itemInfo = mCurLocation->newItemInfo(fi.urlPath());
48+ item = created_itemInfo;
49+ needs_authentication = item->needsAuthentication();
50+ }
51+ }
52+ //item needs authentication and there is no user/password to try
53+ // or there is a user/password already used but failed
54+ if (needs_authentication)
55 {
56 mCurLocation->notifyItemNeedsAuthentication(&fi);
57 //return true to avoid any error message to appear
58@@ -990,15 +1003,23 @@
59 ret = true;
60 }
61 else
62- {
63- if (fi.isContentReadable())
64+ {
65+ if (item->isContentReadable())
66 {
67- mCurLocation->setInfoItem(fi);
68+ mCurLocation->setInfoItem(*item);
69 setPathFromCurrentLocation();
70 ret = true;
71 }
72+ else
73+ {
74+ //some other error
75+ }
76 }
77 }
78+ if (created_itemInfo != 0)
79+ {
80+ delete created_itemInfo;
81+ }
82 return ret;
83 }
84
85
86=== modified file 'src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.cpp'
87--- src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.cpp 2015-07-13 20:41:48 +0000
88+++ src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.cpp 2015-09-19 16:16:16 +0000
89@@ -92,14 +92,11 @@
90 break;
91 }
92 //all the information should be in place now
93- fillFromStatBuf(st);
94-}
95-
96-
97-QString SmbItemInfo::authenticationPath() const
98-{
99- return sharePath();
100-}
101+ fillFromStatBuf(st);
102+ //set the field here to use on any DirItemInfo object
103+ d_ptr->_authenticationPath = sharePath();
104+}
105+
106
107 /*!
108 * \brief SmbItemInfo::sharePath() returns the share part of the item
109
110=== modified file 'src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.h'
111--- src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.h 2015-03-14 17:38:50 +0000
112+++ src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.h 2015-09-19 16:16:16 +0000
113@@ -41,8 +41,7 @@
114
115 public:
116 QString sharePath() const;
117- void setAsShare();
118- virtual QString authenticationPath() const;
119+ void setAsShare();
120 virtual void setFile(const QString &dir, const QString & file);
121
122 protected:

Subscribers

People subscribed via source and target branches