...
 
Commits (16)
cmake_minimum_required(VERSION 3.0)
set(GDRIVE_VERSION 1.3.70)
project(kio-gdrive VERSION ${GDRIVE_VERSION})
# KDE Application Version, managed by release script
set (RELEASE_SERVICE_VERSION_MAJOR "20")
set (RELEASE_SERVICE_VERSION_MINOR "11")
set (RELEASE_SERVICE_VERSION_MICRO "70")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
project(kio-gdrive VERSION ${RELEASE_SERVICE_VERSION})
set(QT_MIN_VERSION 5.2.0)
set(KF5_MIN_VERSION 5.71.0)
......@@ -54,16 +58,13 @@ if(NOT Qt5Test_FOUND)
set(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.")
endif()
ecm_setup_version(PROJECT
ecm_setup_version(${RELEASE_SERVICE_VERSION}
VARIABLE_PREFIX GDRIVE
VERSION_HEADER gdriveversion.h)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_definitions(-DQT_STRICT_ITERATORS)
add_definitions(-DTRANSLATION_DOMAIN=\"kio5_gdrive\")
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000)
endif()
if(BUILD_TESTING)
add_subdirectory(autotests)
......
This diff is collapsed.
......@@ -73,8 +73,8 @@
<summary xml:lang="zh-TW">適用於 KDE Plasma 和 KDE 應用程式的 Google Drive 整合</summary>
<description>
<p>KIO GDrive is a KIO slave that enables KIO-aware applications (such as Dolphin, Kate or Gwenview) to access and edit Google Drive files on the cloud.</p>
<p xml:lang="ca">El KIO GDrive és un esclau del KIO que habilita les aplicacions preparades per al KIO (com el Dolphin, el Kate o el Gwenview) per accedir i editar fitxers del Drive de Google en el núvol.</p>
<p xml:lang="ca-valencia">El KIO GDrive és un esclau del KIO que habilita les aplicacions preparades per al KIO (com el Dolphin, el Kate o el Gwenview) per accedir i editar fitxers del Drive de Google en el núvol.</p>
<p xml:lang="ca">El KIO GDrive és un esclau del KIO que permet a les aplicacions preparades per al KIO (com el Dolphin, el Kate o el Gwenview) que accedeixin i editin els fitxers del Drive de Google en el núvol.</p>
<p xml:lang="ca-valencia">El KIO GDrive és un esclau del KIO que permet a les aplicacions preparades per al KIO (com el Dolphin, el Kate o el Gwenview) que accedisquen i editin els fitxers del Drive de Google en el núvol.</p>
<p xml:lang="da">KIO GDrive er en KIO-slave der gør det muligt for KIO-bevidste programmer (såsom Dolphin, Kate eller Gwenview) at tilgå og redigere Google Drive-filer i skyen.</p>
<p xml:lang="de">KIO GDrive ist ein Ein-/Ausgabemodul, mit dem Anwendungen wie Dolphin, Kate oder Gwenview auf Dateien in der Cloud Google Drive zugreifen und bearbeiten können.</p>
<p xml:lang="el">Το KIO GDrive είναι ένας KIO slave που ενεργοποιεί εφαρμογές με επίγνωση του KIO (όπως Dolphin, Kate ή Gwenview) για την πρόσβαση και επεξεργασία αρχείων του Google Drive στο νέφος.</p>
......@@ -139,6 +139,9 @@
<image type="source" width="1664" height="936">https://cdn.kde.org/screenshots/kio-gdrive/kio-gdrive.png</image>
</screenshot>
</screenshots>
<releases>
<release date="2020-04-12" version="1.3.0"/>
</releases>
<project_group>KDE</project_group>
<categories>
<category>Network</category>
......
......@@ -69,8 +69,8 @@ Name[x-test]=xxNew Account Addedxx
Name[zh_CN]=新帐户已添加
Name[zh_TW]=已新增帳號
Comment= Shortcut to browse Google Drive files as soon as a new Google account has been added.
Comment[ca]=Drecera per explorar els fitxers de Google Drive tan aviat com s'afegeixi un compte nou de Google.
Comment[ca@valencia]=Drecera per explorar els fitxers de Google Drive tan prompte com s'afija un compte nou de Google.
Comment[ca]=Drecera per a explorar els fitxers de Google Drive tan aviat com s'afegeixi un compte nou de Google.
Comment[ca@valencia]=Drecera per a explorar els fitxers de Google Drive tan prompte com s'afija un compte nou de Google.
Comment[da]=Genvej til at gennemse Google Drev-filer så snart en ny Google-konto er blevet tilføjet.
Comment[de]=Kurzbefehl zum Durchsuchen von Dateien auf Google Drive, sobald ein neuer Zugang für Google hinzugefügt wurde.
Comment[el]=Συντόμευση για περιήγηση σε αρχεία του Google Drive αμέσως μόλις προστεθεί νέος λογαριασμός Google.
......
......@@ -31,6 +31,7 @@
"Name[ca@valencia]": "KIO GDrive",
"Name[ca]": "KIO GDrive",
"Name[cs]": "KIO gdrive",
"Name[da]": "KIO gdrive",
"Name[en_GB]": "KIO gdrive",
"Name[es]": "KIO gdrive",
"Name[et]": "KIO GDrive",
......
......@@ -22,7 +22,9 @@
#include "gdriveurl.h"
const QString GDriveUrl::Scheme = QLatin1String("gdrive");
const QString GDriveUrl::MyDriveDir = QLatin1String("My Drive");
const QString GDriveUrl::SharedDrivesDir = QLatin1String("Shared Drives");
const QString GDriveUrl::SharedWithMeDir = QLatin1String("Shared with me");
const QString GDriveUrl::TrashDir = QLatin1String("trash");
const QString GDriveUrl::NewAccountPath = QLatin1String("new-account");
......@@ -30,7 +32,11 @@ GDriveUrl::GDriveUrl(const QUrl &url)
: m_url(url)
{
const auto path = url.adjusted(QUrl::StripTrailingSlash).path();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
m_components = path.split(QLatin1Char('/'), QString::SkipEmptyParts);
#else
m_components = path.split(QLatin1Char('/'), Qt::SkipEmptyParts);
#endif
}
QString GDriveUrl::account() const
......@@ -66,9 +72,14 @@ bool GDriveUrl::isNewAccountPath() const
return m_components.length() == 1 && m_components.at(0) == NewAccountPath;
}
bool GDriveUrl::isTopLevel() const
bool GDriveUrl::isMyDriveRoot() const
{
return m_components.length() == 2;
return m_components.length() == 2 && m_components.at(1) == MyDriveDir;
}
bool GDriveUrl::isMyDriveTopLevel() const
{
return m_components.length() == 3 && m_components.at(1) == MyDriveDir;
}
bool GDriveUrl::isSharedDrivesRoot() const
......@@ -81,6 +92,21 @@ bool GDriveUrl::isSharedDrive() const
return m_components.length() == 3 && m_components.at(1) == SharedDrivesDir;
}
bool GDriveUrl::isSharedDriveTopLevel() const
{
return m_components.length() == 4 && m_components.at(1) == SharedDrivesDir;
}
bool GDriveUrl::isSharedWithMeRoot() const
{
return m_components.length() == 2 && m_components.at(1) == SharedWithMeDir;
}
bool GDriveUrl::isSharedWithMeTopLevel() const
{
return m_components.length() == 3 && m_components.at(1) == SharedWithMeDir;
}
bool GDriveUrl::isTrashDir() const
{
return m_components.length() == 2 && m_components.at(1) == TrashDir;
......@@ -112,3 +138,8 @@ QStringList GDriveUrl::pathComponents() const
{
return m_components;
}
QString GDriveUrl::buildSharedDrivePath(const QString &accountId, const QString &drive)
{
return QStringLiteral("/%1/%2/%3").arg(accountId, SharedDrivesDir, drive);
}
......@@ -34,17 +34,25 @@ public:
bool isRoot() const;
bool isAccountRoot() const;
bool isNewAccountPath() const;
bool isTopLevel() const;
bool isMyDriveRoot() const;
bool isMyDriveTopLevel() const;
bool isSharedDrivesRoot() const;
bool isSharedDrive() const;
bool isSharedDriveTopLevel() const;
bool isSharedWithMeRoot() const;
bool isSharedWithMeTopLevel() const;
bool isTrashDir() const;
bool isTrashed() const;
QUrl url() const;
QString parentPath() const;
QStringList pathComponents() const;
static QString buildSharedDrivePath(const QString &accountId, const QString &drive);
static const QString Scheme;
static const QString MyDriveDir;
static const QString SharedDrivesDir;
static const QString SharedWithMeDir;
static const QString TrashDir;
static const QString NewAccountPath;
......
This diff is collapsed.
......@@ -87,15 +87,22 @@ private:
static KIO::UDSEntry sharedDriveToUDSEntry(const KGAPI2::Drive::DrivesPtr &sharedDrive);
void listAccounts();
void listAccountRoot(const QString &accountId);
void createAccount();
KIO::UDSEntry myDriveRootUDSEntry();
void listSharedDrivesRoot(const QUrl &url);
bool createSharedDrive(const QUrl &url);
bool deleteSharedDrive(const QUrl &url);
void statSharedDrive(const QUrl &url);
KIO::UDSEntry fetchSharedDrivesRootEntry(const QString &accountId, FetchEntryFlags flags = FetchEntryFlags::None);
void listSharedWithMeRoot(const QUrl &url);
KIO::UDSEntry fetchSharedWithMeRootEntry(FetchEntryFlags flags = FetchEntryFlags::None);
QString resolveFileIdFromPath(const QString &path, PathFlags flags = None);
QString resolveSharedDriveId(const QString &idOrName, const QString &accountId);
Action handleError(const KGAPI2::Job &job, const QUrl &url);
KIO::UDSEntry fileToUDSEntry(const KGAPI2::Drive::FilePtr &file, const QString &path) const;
......