Skip to content
This repository has been archived by the owner on Mar 4, 2023. It is now read-only.

Commit

Permalink
project cleanup, prepare for release
Browse files Browse the repository at this point in the history
  • Loading branch information
Skycoder42 committed Jul 13, 2018
1 parent 0f40797 commit 4e58719
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 229 deletions.
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,19 @@ More features, such as sharing, etc. are planned.
### Limitations/Workaround
Due to the way those dolphin plugins work, only repositories that are inside your seafile main directory will work. Additionally, you will have to open this folder once, before the plugin recognizes them.

The reason is, that the plugin reacts on the presence of the `.seafile-data` folder. If you have custom locations outside of the folder, or don't want to always go there first, simply create an empty file called `.seafile-data` in whichever directory you need the plugin to work.
The reason is, that the plugin reacts on the presence of the `.seafile-data` folder. If you have custom locations outside of the folder, or don't want to always go there first, simply create an empty file called `.seafile-data` in whichever directory you need the plugin to work.
One useful location would be your home directory, as thats the default directory dolphin opens.

I'll try to work around that issue in future versions.

## Dependencies
You'll need Dolphin (and thus Qt and KDE frameworks) and Seafile. The plugin only needs the seafile daemon, so make shure you have that one with whatever seafile package you use. Also, ccnet is required, but as it's a depedency of seafile, should always be present.
You'll need Dolphin (and thus Qt and KDE frameworks) and Seafile. The plugin only needs the seafile daemon, so make shure you have that one with whatever seafile package you use.

## Installation
For now, only an AUR package is provided: [`dolphin-seafile-plugin`](https://aur.archlinux.org/packages/dolphin-seafile-plugin)
Debian packages and others I will provide as soon as possible.
For now, only an AUR package is provided: [`dolphin-seafile-plugin`](https://aur.archlinux.org/packages/dolphin-seafile-plugin)

Until then, you can simply build it yourself. Install all the stated dependencies and build via:
```
cd plugin
qmake
make
make install
```
```
23 changes: 0 additions & 23 deletions TestLoader/TestLoader.pro

This file was deleted.

15 changes: 0 additions & 15 deletions TestLoader/main.cpp

This file was deleted.

4 changes: 3 additions & 1 deletion dolphin-seafile-plugin.pro
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
TEMPLATE = subdirs

SUBDIRS += plugin \
TestLoader \
seafile-test

OTHER_FILES += \
README.md
3 changes: 1 addition & 2 deletions plugin/fileviewseafileplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ FileViewSeafilePlugin::FileViewSeafilePlugin(QObject *parent, const QVariantList

QString FileViewSeafilePlugin::fileName() const
{
return QStringLiteral(".seafile-data");//TODO works, but not for repos outside of the "seafile dir"
return QStringLiteral(".seafile-data");
}

bool FileViewSeafilePlugin::beginRetrieval(const QString &directory)
{
Q_UNUSED(directory)
try {
_seaf->engage();
_seaf->reloadRepos();
Expand Down
11 changes: 5 additions & 6 deletions plugin/plugin.pro
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
TEMPLATE = lib

QT += core gui widgets KIOCore
QT = core gui widgets KIOCore

CONFIG += plugin warning_clean exceptions link_pkgconfig

# add seafile, ccnet
PKGCONFIG += libseafile libccnet
PKGCONFIG += libseafile

#dolphin
LIBS += -ldolphinvcs
INCLUDEPATH += /usr/include/Dolphin/


TARGET = fileviewseafileplugin
VERSION = 1.0.0
VERSION = 1.1.0

DEFINES += QT_DEPRECATED_WARNINGS QT_ASCII_CAST_WARNINGS

HEADERS += \
fileviewseafileplugin.h \
fileviewseafileplugin.h \
seafstatus.h

SOURCES += \
fileviewseafileplugin.cpp \
fileviewseafileplugin.cpp \
seafstatus.cpp

DISTFILES += \
Expand Down
15 changes: 10 additions & 5 deletions plugin/seafstatus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,16 @@ void SeafStatus::reloadRepos()
g_list_free(res);
}

bool SeafStatus::hasRepo(const QString &path)
bool SeafStatus::hasRepo(const QString &path) const
{
return _repoIds.contains(repoPath(path));
}

QStringList SeafStatus::allRepost() const
{
return _repoIds.keys();
}

SeafStatus::SyncStatus SeafStatus::syncStatus(const QString &path)
{
ensureConnected();
Expand Down Expand Up @@ -147,7 +152,7 @@ void SeafStatus::freeConnection()
}
}

QString SeafStatus::repoPath(const QString &path)
QString SeafStatus::repoPath(const QString &path) const
{
QFileInfo info(path);
auto fullPath = QDir::cleanPath(info.absoluteFilePath());
Expand All @@ -161,7 +166,7 @@ QString SeafStatus::repoPath(const QString &path)
return QString();
}

SeafStatus::SyncStatus SeafStatus::mapFileStatus(const QByteArray &text)
SeafStatus::SyncStatus SeafStatus::mapFileStatus(const QByteArray &text) const
{
static const QHash<QByteArray, SeafStatus::SyncStatus> PathStatus {
{"none", None},
Expand All @@ -177,7 +182,7 @@ SeafStatus::SyncStatus SeafStatus::mapFileStatus(const QByteArray &text)
return PathStatus.value(text, Invalid);
}

SeafStatus::SyncStatus SeafStatus::mapRepoStatus(const QByteArray &text)
SeafStatus::SyncStatus SeafStatus::mapRepoStatus(const QByteArray &text) const
{
static const QHash<QByteArray, SeafStatus::SyncStatus> PathStatus {
{"synchronized", Synced},
Expand All @@ -195,7 +200,7 @@ SeafStatus::SyncStatus SeafStatus::mapRepoStatus(const QByteArray &text)
return PathStatus.value(text, None);
}

QString SeafStatus::readSeafileIni()
QString SeafStatus::readSeafileIni() const
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
auto env = qEnvironmentVariable("SEAFILE_DATA_DIR");
Expand Down
11 changes: 6 additions & 5 deletions plugin/seafstatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class SeafStatus : public QObject

void reloadRepos();

bool hasRepo(const QString &path);
bool hasRepo(const QString &path) const;
QStringList allRepost() const;
SyncStatus syncStatus(const QString &path);

private slots:
Expand All @@ -68,10 +69,10 @@ private slots:
QHash<QString, QUuid> _repoIds;
QTimer *_conTimer;

QString repoPath(const QString &path);
SyncStatus mapFileStatus(const QByteArray &text);
SyncStatus mapRepoStatus(const QByteArray &text);
QString readSeafileIni();
QString repoPath(const QString &path) const;
SyncStatus mapFileStatus(const QByteArray &text) const;
SyncStatus mapRepoStatus(const QByteArray &text) const;
QString readSeafileIni() const;
};

#endif // SEAFSTATUS_H
32 changes: 8 additions & 24 deletions seafile-test/seafile-test.pro
Original file line number Diff line number Diff line change
@@ -1,32 +1,16 @@
QT += core
QT -= gui
TEMPLATE = app

CONFIG += c++11
QT = core

TARGET = seafile-test
CONFIG += console
CONFIG += link_pkgconfig console
CONFIG -= app_bundle
PKGCONFIG += libseafile

TEMPLATE = app
TARGET = seafile-test

HEADERS += \
seafstatus.h

SOURCES += \
main.cpp \
seafstatus.cpp

# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

CONFIG += link_pkgconfig
PKGCONFIG += libseafile libccnet

HEADERS += \
/usr/include/seafile/seafile-rpc.h \
seafstatus.h
98 changes: 0 additions & 98 deletions seafile-test/seafstatus.cpp

This file was deleted.

1 change: 1 addition & 0 deletions seafile-test/seafstatus.cpp
43 changes: 0 additions & 43 deletions seafile-test/seafstatus.h

This file was deleted.

1 change: 1 addition & 0 deletions seafile-test/seafstatus.h

0 comments on commit 4e58719

Please sign in to comment.