Commit 2291bfd4 authored by David Barchiesi's avatar David Barchiesi

Add and use an enum for tracking UDSEntry extras.

parent 6699fd16
/*
* 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
......@@ -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(GDriveUDSEntryExtras::Url);
// Ignore if missing a shareable link
if (gdriveLink.isEmpty()) {
return {};
......
......@@ -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(GDriveUDSEntryExtras::Url, file->alternateLink().toString());
return entry;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment