Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
79 changes: 56 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,68 @@
PROJECT(kfilebox)
FIND_PACKAGE(KDE4 REQUIRED)
include_directories( ${QT_INCLUDES} ${KDE4_INCLUDES})
cmake_minimum_required(VERSION 2.8.12)

SET(QT_USE_QTNETWORK TRUE)
SET(QT_USE_QTSQL TRUE)
SET(QT_USE_QTDBUS TRUE)
project(kfilebox)

SET(kfilebox_cpp main.cpp src/configuration.cpp src/dropboxclientadaptor.cpp src/installerform.cpp src/notification.cpp src/configurationdbdriver.cpp src/dropboxclient.cpp src/mainwindow.cpp)
SET(kfilebox_h src/configurationdbdriver.h src/dropboxclientadaptor.h src/installerform.h src/notification.h src/configuration.h src/dropboxclient.h src/mainwindow.h)
SET(kfilebox_ui src/mainwindow.ui src/installerform.ui)
SET(kfilebox_qrc DropboxIcons.qrc)
# Require extra-cmake-modules
find_package(ECM REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
set(CMAKE_INCLUDE_CURRENT_DIR ON)

INCLUDE(${QT_USE_FILE})
# Automatically handle the usual Qt5 tasks
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

OPTION(ENABLE_DBUS "Add dbus communication layer" ON)
# Helper modules provided by extra-cmake-modules
include(ECMInstallIcons)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)

#CONFIGURE_FILE(config.h.in config.h)
find_package(Qt5 REQUIRED COMPONENTS
Core
Widgets
Network
DBus
Sql
)

QT4_WRAP_CPP(kfilebox_moc_cpp ${kfilebox_h})
QT4_WRAP_UI(kfilebox_ui_h ${kfilebox_ui})
QT4_ADD_RESOURCES(kfilebox_resources_rcc ${kfilebox_qrc})
find_package(KF5 REQUIRED COMPONENTS
Config
CoreAddons
I18n
Notifications
)

ADD_SUBDIRECTORY(locale)
set(kfilebox_sources
main.cpp
DropboxIcons.qrc
src/configuration.cpp
src/configurationdbdriver.cpp
src/dropboxclientadaptor.cpp
src/installerform.cpp
src/notification.cpp
src/dropboxclient.cpp
src/mainwindow.cpp
)

ADD_EXECUTABLE(kfilebox ${kfilebox_cpp} ${kfilebox_moc_cpp} ${kfilebox_ui_h} ${kfilebox_resources_rcc})
option(ENABLE_DBUS "Add dbus communication layer" ON)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(po)
add_subdirectory(icons)

TARGET_LINK_LIBRARIES(kfilebox ${QT_LIBRARIES} ${KDE4_KDEUI_LIBS} ${KDE4_KDECORE_LIBS} )
add_executable(kfilebox ${kfilebox_sources})

INSTALL(TARGETS kfilebox DESTINATION bin)
target_link_libraries(kfilebox
Qt5::Widgets
Qt5::Network
Qt5::DBus
Qt5::Sql
KF5::ConfigCore
KF5::ConfigGui
KF5::CoreAddons
KF5::I18n
KF5::Notifications)

# install icons and some stuff
#translations
install(TARGETS kfilebox ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(PROGRAMS kfilebox.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES kfilebox.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR})
Empty file modified DropboxIcons.qrc
100755 → 100644
Empty file.
Binary file added icons/128-apps-kfilebox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/16-apps-kfilebox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/22-apps-kfilebox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/24-apps-kfilebox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/32-apps-kfilebox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/48-apps-kfilebox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/64-apps-kfilebox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions icons/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

# Install hicolor icons to standard locations depending on filename
# (e.g. $prefix/share/icons/hicolor/128x128/apps/kfilebox.png)
ecm_install_icons(ICONS
128-apps-kfilebox.png
16-apps-kfilebox.png
22-apps-kfilebox.png
24-apps-kfilebox.png
32-apps-kfilebox.png
48-apps-kfilebox.png
64-apps-kfilebox.png
DESTINATION ${ICON_INSTALL_DIR}
THEME hicolor
)
113 changes: 67 additions & 46 deletions main.cpp
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,46 +1,67 @@
#include <QObject>

#include "kuniqueapplication.h"
/* for debugging...
#include "kapplication.h"
*/

#include "kaboutdata.h"
#include "kcmdlineargs.h"
//#include "klocale.h"
//! @todo should I replace all tr() calls to ki18n()?

#include "src/mainwindow.h"


int main(int argc, char** argv)
{
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));

KAboutData aboutData("kfilebox",
0,
ki18n("kfilebox"),
"0.4.10",
ki18n("KDE Dropbox frontend"),
KAboutData::License_GPL_V3,
ki18n("(c) 2011"),
ki18n("Kfilebox is a KDE frontend to Dropbox"),
"http://sourceforge.net/projects/kdropbox/",
"nib952051@gmail.com - fixes by GT (https://github.com/gtgt)");

aboutData.setBugAddress("https://github.com/gtgt/kfilebox/issues");
KCmdLineArgs::init( argc, argv, &aboutData );
KUniqueApplication a;
KUniqueApplication::setQuitOnLastWindowClosed(false);

/* for debugging...
KApplication a;
KApplication::setQuitOnLastWindowClosed(false);
*/


MainWindow w;
Q_UNUSED(w);

return a.exec();
}
#include <QApplication>
#include <KAboutData>
#include <KLocalizedString>

#include "src/mainwindow.h"

int main(int argc, char** argv)
{
//QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));

/*
* Create the application
*/
QApplication app(argc, argv);

/*
* Connect application with translation catalogs
*/
KLocalizedString::setApplicationDomain("kfilebox");

/*
* Construct about data for kfilebox
*/
KAboutData aboutData(QStringLiteral("kfilebox"),
i18n("Kfilebox"),
QStringLiteral("0.4.95"),
i18n("KDE Dropbox frontend"),
KAboutLicense::GPL_V3,
i18n("Copyright (C) 2011-2015"),
QString(),
QStringLiteral("https://github.com/gtgt/kfilebox"));
//"nib952051@gmail.com - fixes by GT (https://github.com/gtgt)");

//aboutData.setOrganizationDomain("kde.org");
aboutData.setBugAddress("https://github.com/gtgt/kfilebox/issues");
aboutData.addAuthor(i18n("Guillermo Amat"), QString(), QString(), QString(), QString());

/*
* Register about data
*/
KAboutData::setApplicationData(aboutData);

/*
* Set app settings from KAboutData
*/
app.setApplicationName(aboutData.componentName());
app.setApplicationDisplayName(aboutData.displayName());
app.setOrganizationDomain(aboutData.organizationDomain());
app.setApplicationVersion(aboutData.version());
app.setQuitOnLastWindowClosed(false);

/*
* Create command line parser and handle standard options
*/
QCommandLineParser parser;
aboutData.setupCommandLine(&parser);
parser.setApplicationDescription(aboutData.shortDescription());
parser.addHelpOption();
parser.addVersionOption();
parser.process(app);
aboutData.processCommandLine(&parser);

MainWindow w;
Q_UNUSED(w);

return app.exec();
}
15 changes: 15 additions & 0 deletions po/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
find_package(Gettext REQUIRED)

file(GLOB _poFileList *.po)

foreach(_poFile ${_poFileList})
get_filename_component(_poFileName ${_poFile} NAME)
string(REGEX REPLACE "\\.po$" "" _lang ${_poFileName})

if(_lang)
gettext_process_po_files(${_lang} ALL PO_FILES ${_poFile})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo
DESTINATION ${LOCALE_INSTALL_DIR}/${_lang}/LC_MESSAGES
RENAME kfilebox.mo)
endif()
endforeach()
Loading