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

Proposed by Carlos Jose Mazieri
Status: Merged
Approved by: Arto Jalkanen
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
Ubuntu File Manager Developers 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.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
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-19 16:16:16 +0000
+++ src/plugin/folderlistmodel/diriteminfo.cpp 2015-09-19 16:16:16 +0000
@@ -407,7 +407,7 @@
407407
408QString DirItemInfo::authenticationPath() const408QString DirItemInfo::authenticationPath() const
409{409{
410 return QLatin1String(0);410 return d_ptr->_authenticationPath;
411}411}
412412
413413
414414
=== modified file 'src/plugin/folderlistmodel/diriteminfo.h'
--- src/plugin/folderlistmodel/diriteminfo.h 2015-09-19 16:16:16 +0000
+++ src/plugin/folderlistmodel/diriteminfo.h 2015-09-19 16:16:16 +0000
@@ -176,6 +176,7 @@
176 QString _path;176 QString _path;
177 QString _fileName;177 QString _fileName;
178 QString _normalizedPath;178 QString _normalizedPath;
179 QString _authenticationPath;
179180
180 static QMimeDatabase mimeDatabase;181 static QMimeDatabase mimeDatabase;
181};182};
182183
=== modified file 'src/plugin/folderlistmodel/dirmodel.cpp'
--- src/plugin/folderlistmodel/dirmodel.cpp 2015-09-19 16:16:16 +0000
+++ src/plugin/folderlistmodel/dirmodel.cpp 2015-09-19 16:16:16 +0000
@@ -978,11 +978,24 @@
978bool DirModel::cdIntoItem(const DirItemInfo &fi)978bool DirModel::cdIntoItem(const DirItemInfo &fi)
979{979{
980 bool ret = false;980 bool ret = false;
981 const DirItemInfo *item = &fi;
982 DirItemInfo *created_itemInfo = 0;
981 if (fi.isBrowsable())983 if (fi.isBrowsable())
982 {984 {
983 bool authentication = fi.needsAuthentication() &&985 bool needs_authentication = fi.needsAuthentication();
984 !mCurLocation->useAuthenticationDataIfExists(fi);986 if (needs_authentication)
985 if (authentication)987 {
988 if (mCurLocation->useAuthenticationDataIfExists(fi))
989 {
990 //there is a password stored to try
991 created_itemInfo = mCurLocation->newItemInfo(fi.urlPath());
992 item = created_itemInfo;
993 needs_authentication = item->needsAuthentication();
994 }
995 }
996 //item needs authentication and there is no user/password to try
997 // or there is a user/password already used but failed
998 if (needs_authentication)
986 {999 {
987 mCurLocation->notifyItemNeedsAuthentication(&fi);1000 mCurLocation->notifyItemNeedsAuthentication(&fi);
988 //return true to avoid any error message to appear1001 //return true to avoid any error message to appear
@@ -990,15 +1003,23 @@
990 ret = true;1003 ret = true;
991 }1004 }
992 else1005 else
993 {1006 {
994 if (fi.isContentReadable())1007 if (item->isContentReadable())
995 {1008 {
996 mCurLocation->setInfoItem(fi);1009 mCurLocation->setInfoItem(*item);
997 setPathFromCurrentLocation();1010 setPathFromCurrentLocation();
998 ret = true;1011 ret = true;
999 }1012 }
1013 else
1014 {
1015 //some other error
1016 }
1000 }1017 }
1001 }1018 }
1019 if (created_itemInfo != 0)
1020 {
1021 delete created_itemInfo;
1022 }
1002 return ret;1023 return ret;
1003}1024}
10041025
10051026
=== modified file 'src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.cpp'
--- src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.cpp 2015-07-13 20:41:48 +0000
+++ src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.cpp 2015-09-19 16:16:16 +0000
@@ -92,14 +92,11 @@
92 break;92 break;
93 }93 }
94 //all the information should be in place now94 //all the information should be in place now
95 fillFromStatBuf(st); 95 fillFromStatBuf(st);
96}96 //set the field here to use on any DirItemInfo object
9797 d_ptr->_authenticationPath = sharePath();
9898}
99QString SmbItemInfo::authenticationPath() const99
100{
101 return sharePath();
102}
103100
104/*!101/*!
105 * \brief SmbItemInfo::sharePath() returns the share part of the item102 * \brief SmbItemInfo::sharePath() returns the share part of the item
106103
=== modified file 'src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.h'
--- src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.h 2015-03-14 17:38:50 +0000
+++ src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.h 2015-09-19 16:16:16 +0000
@@ -41,8 +41,7 @@
4141
42public:42public:
43 QString sharePath() const;43 QString sharePath() const;
44 void setAsShare();44 void setAsShare();
45 virtual QString authenticationPath() const;
46 virtual void setFile(const QString &dir, const QString & file);45 virtual void setFile(const QString &dir, const QString & file);
4746
48protected: 47protected:

Subscribers

People subscribed via source and target branches