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
KIO GDrive
Commits
2291bfd4
Commit
2291bfd4
authored
May 30, 2020
by
David Barchiesi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add and use an enum for tracking UDSEntry extras.
parent
6699fd16
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
2 deletions
+41
-2
src/gdrive_udsentry.h
src/gdrive_udsentry.h
+37
-0
src/integration/copyurlitemaction/copyurlitemaction.cpp
src/integration/copyurlitemaction/copyurlitemaction.cpp
+2
-1
src/kio_gdrive.cpp
src/kio_gdrive.cpp
+2
-1
No files found.
src/gdrive_udsentry.h
0 → 100644
View file @
2291bfd4
/*
* Copyright 2020 David Barchiesi <david@barchie.si>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GDRIVEUDSENTRY_H
#define GDRIVEUDSENTRY_H
#include <KIO/UDSEntry>
enum
GDriveUDSEntryExtras
{
Url
=
KIO
::
UDSEntry
::
UDS_EXTRA
,
Id
,
Md5
,
Owners
,
Version
,
LastModifyingUser
,
Description
};
#endif // GDRIVEUDSENTRY_H
src/integration/copyurlitemaction/copyurlitemaction.cpp
View file @
2291bfd4
...
...
@@ -18,6 +18,7 @@
*/
#include "copyurlitemaction.h"
#include "../../gdrive_udsentry.h"
#include <QGuiApplication>
#include <QClipboard>
...
...
@@ -50,7 +51,7 @@ QList<QAction*> CopyUrlItemAction::actions(const KFileItemListProperties& fileIt
}
const
KIO
::
UDSEntry
entry
=
item
.
entry
();
const
QString
gdriveLink
=
entry
.
stringValue
(
KIO
::
UDSEntry
::
UDS_EXTRA
);
const
QString
gdriveLink
=
entry
.
stringValue
(
GDrive
UDSEntry
Extras
::
Url
);
// Ignore if missing a shareable link
if
(
gdriveLink
.
isEmpty
())
{
return
{};
...
...
src/kio_gdrive.cpp
View file @
2291bfd4
...
...
@@ -23,6 +23,7 @@
#include "gdrivehelper.h"
#include "gdriveurl.h"
#include "gdriveversion.h"
#include "gdrive_udsentry.h"
#include <QApplication>
#include <QMimeDatabase>
...
...
@@ -236,7 +237,7 @@ KIO::UDSEntry KIOGDrive::fileToUDSEntry(const FilePtr &origFile, const QString &
entry
.
fastInsert
(
KIO
::
UDSEntry
::
UDS_ACCESS
,
S_IRUSR
|
S_IWUSR
|
S_IXUSR
|
S_IRGRP
|
S_IWGRP
|
S_IXGRP
|
S_IROTH
|
S_IXOTH
);
}
entry
.
fastInsert
(
KIO
::
UDSEntry
::
UDS_EXTRA
,
file
->
alternateLink
().
toString
());
entry
.
fastInsert
(
GDrive
UDSEntry
Extras
::
Url
,
file
->
alternateLink
().
toString
());
return
entry
;
}
...
...
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