Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Network
KAccounts Integration
Commits
a4639631
Commit
a4639631
authored
Oct 20, 2020
by
Nicolas Fella
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor code optimization
A lot of const and some string fixes
parent
c64e3731
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
16 deletions
+14
-16
src/plugins/kio-webdav/createkioservice.cpp
src/plugins/kio-webdav/createkioservice.cpp
+5
-5
src/plugins/kio-webdav/createnetattachjob.cpp
src/plugins/kio-webdav/createnetattachjob.cpp
+5
-6
src/plugins/kio-webdav/kioservices.cpp
src/plugins/kio-webdav/kioservices.cpp
+3
-4
src/plugins/kio-webdav/removenetattachjob.cpp
src/plugins/kio-webdav/removenetattachjob.cpp
+1
-1
No files found.
src/plugins/kio-webdav/createkioservice.cpp
View file @
a4639631
...
...
@@ -50,14 +50,14 @@ void CreateKioService::gotCredentials(KJob *job)
}
GetCredentialsJob
*
gjob
=
qobject_cast
<
GetCredentialsJob
*>
(
job
);
QVariantMap
data
=
gjob
->
credentialsData
();
const
QVariantMap
data
=
gjob
->
credentialsData
();
Accounts
::
Service
service
=
m_manager
->
service
(
m_serviceName
);
QString
host
=
m_account
->
value
(
QStringLiteral
(
"dav/host"
)).
toString
();
QString
path
=
m_account
->
value
(
QStringLiteral
(
"dav/storagePath"
)).
toString
();
const
Accounts
::
Service
service
=
m_manager
->
service
(
m_serviceName
);
const
QString
host
=
m_account
->
value
(
QStringLiteral
(
"dav/host"
)).
toString
();
const
QString
path
=
m_account
->
value
(
QStringLiteral
(
"dav/storagePath"
)).
toString
();
m_account
->
selectService
(
service
);
QString
username
=
data
[
QStringLiteral
(
"UserName"
)].
toString
();
const
QString
username
=
data
[
QStringLiteral
(
"UserName"
)].
toString
();
CreateNetAttachJob
*
netJob
=
new
CreateNetAttachJob
(
this
);
connect
(
netJob
,
&
CreateNetAttachJob
::
finished
,
this
,
&
CreateKioService
::
netAttachCreated
);
...
...
src/plugins/kio-webdav/createnetattachjob.cpp
View file @
a4639631
...
...
@@ -103,16 +103,15 @@ void CreateNetAttachJob::createDesktopFile(const QUrl &url)
{
qDebug
();
QString
path
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericDataLocation
);
path
.
append
(
QStringLiteral
(
"/remoteview/"
));
const
QString
folderPath
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericDataLocation
)
+
QLatin1String
(
"/remoteview/"
);
QDir
saveDir
(
p
ath
);
QDir
saveDir
(
folderP
ath
);
if
(
!
saveDir
.
exists
())
{
if
(
!
saveDir
.
mkpath
(
p
ath
))
{
qWarning
()
<<
"Directory"
<<
p
ath
<<
"for storage couldn't be created!"
;
if
(
!
saveDir
.
mkpath
(
folderP
ath
))
{
qWarning
()
<<
"Directory"
<<
folderP
ath
<<
"for storage couldn't be created!"
;
}
}
path
+=
m_uniqueId
+
QStringLiteral
(
".desktop"
);
const
QString
path
=
folderPath
+
m_uniqueId
+
QStringLiteral
(
".desktop"
);
qDebug
()
<<
"Creating knetAttach place"
;
qDebug
()
<<
path
;
...
...
src/plugins/kio-webdav/kioservices.cpp
View file @
a4639631
...
...
@@ -46,10 +46,9 @@ void KIOServices::onAccountCreated(const Accounts::AccountId accId, const Accoun
void
KIOServices
::
onAccountRemoved
(
const
Accounts
::
AccountId
accId
)
{
qDebug
();
QString
accountId
=
QString
::
number
(
accId
)
+
QStringLiteral
(
"_"
);
const
QString
accountId
=
QString
::
number
(
accId
)
+
QStringLiteral
(
"_"
);
QString
path
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericDataLocation
);
path
.
append
(
QStringLiteral
(
"/remoteview/"
));
const
QString
path
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericDataLocation
)
+
QLatin1String
(
"/remoteview/"
);
QDirIterator
i
(
path
,
QDir
::
NoDotAndDotDot
|
QDir
::
Files
);
while
(
i
.
hasNext
())
{
...
...
@@ -113,7 +112,7 @@ void KIOServices::disableService(const Accounts::AccountId accId, const QString
bool
KIOServices
::
isEnabled
(
const
Accounts
::
AccountId
accId
,
const
QString
&
serviceName
)
{
QString
uniqueId
(
QString
::
number
(
accId
)
+
QStringLiteral
(
"_"
)
+
serviceName
);
const
QString
uniqueId
(
QString
::
number
(
accId
)
+
QStringLiteral
(
"_"
)
+
serviceName
);
QString
path
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericDataLocation
);
path
+=
QStringLiteral
(
"/remoteview/"
)
+
uniqueId
+
QStringLiteral
(
".desktop"
);
...
...
src/plugins/kio-webdav/removenetattachjob.cpp
View file @
a4639631
...
...
@@ -64,7 +64,7 @@ void RemoveNetAttachJob::deleteDesktopFile()
KConfig
_desktopFile
(
path
,
KConfig
::
SimpleConfig
);
KConfigGroup
desktopFile
(
&
_desktopFile
,
"Desktop Entry"
);
QUrl
url
(
desktopFile
.
readEntry
(
"URL"
,
QUrl
()));
const
QUrl
url
(
desktopFile
.
readEntry
(
"URL"
,
QUrl
()));
Q_ASSERT
(
!
url
.
isEmpty
());
qDebug
()
<<
url
.
userName
()
<<
url
.
host
()
<<
url
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment