mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
WiP: Attempt to compile without UI
This commit is contained in:
parent
934eda128b
commit
77ac092975
@ -11,13 +11,15 @@ endif( BUILD_WITH_QT4 )
|
||||
|
||||
if( Qt5Core_FOUND )
|
||||
message(STATUS "Found Qt5 core, checking for further dependencies...")
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt5Quick REQUIRED)
|
||||
find_package(Qt5PrintSupport REQUIRED)
|
||||
find_package(Qt5WebKit REQUIRED)
|
||||
find_package(Qt5Network REQUIRED)
|
||||
find_package(Qt5Xml REQUIRED)
|
||||
find_package(Qt5WebKitWidgets REQUIRED)
|
||||
if(NOT TOKEN_AUTH_ONLY)
|
||||
find_package(Qt5WebKitWidgets REQUIRED)
|
||||
find_package(Qt5WebKit REQUIRED)
|
||||
find_package(Qt5PrintSupport REQUIRED)
|
||||
find_package(Qt5Quick REQUIRED)
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
endif()
|
||||
if(APPLE)
|
||||
find_package(Qt5MacExtras REQUIRED)
|
||||
endif(APPLE)
|
||||
@ -37,23 +39,27 @@ if( Qt5Core_FOUND )
|
||||
include_directories(${Qt5DBus_INCLUDES})
|
||||
add_definitions(${Qt5DBus_DEFINITIONS})
|
||||
endif (WITH_DBUS)
|
||||
|
||||
include_directories(${Qt5Widgets_INCLUDES})
|
||||
add_definitions(${Qt5Widgets_DEFINITIONS})
|
||||
include_directories(${Qt5Core_INCLUDES})
|
||||
add_definitions(${Qt5Core_DEFINITIONS})
|
||||
if (NOT WIN32) #implied on Win32
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
|
||||
endif(NOT WIN32)
|
||||
# set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
|
||||
|
||||
if(APPLE)
|
||||
if(APPLE AND NOT TOKEN_AUTH_ONLY)
|
||||
include_directories(${Qt5MacExtras_INCLUDE_DIRS})
|
||||
add_definitions(${Qt5MacExtras_DEFINITIONS})
|
||||
set (QT_LIBRARIES ${QT_LIBRARIES} ${Qt5MacExtras_LIBRARIES})
|
||||
endif(APPLE)
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_LIBRARIES_ONLY)
|
||||
macro(qt_wrap_ui)
|
||||
qt5_wrap_ui(${ARGN})
|
||||
endmacro()
|
||||
else()
|
||||
# hack
|
||||
SET(QT_UIC_EXECUTABLE "")
|
||||
endif()
|
||||
|
||||
macro(qt_add_resources)
|
||||
qt5_add_resources(${ARGN})
|
||||
|
||||
@ -27,9 +27,9 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||
)
|
||||
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||
|
||||
if(SPARKLE_FOUND)
|
||||
if(SPARKLE_FOUND AND NOT BUILD_LIBRARIES_ONLY)
|
||||
list (APPEND OS_SPECIFIC_LINK_LIBRARIES ${SPARKLE_LIBRARY})
|
||||
endif(SPARKLE_FOUND)
|
||||
endif()
|
||||
|
||||
set(3rdparty_SRC
|
||||
3rdparty/qtsingleapplication/qtsingleapplication.cpp
|
||||
@ -195,7 +195,11 @@ if(NEON_FOUND)
|
||||
endif()
|
||||
|
||||
add_library(${synclib_NAME} SHARED ${libsync_SRCS} ${syncMoc})
|
||||
qt5_use_modules(${synclib_NAME} Widgets Network Xml WebKitWidgets Sql)
|
||||
if(TOKEN_AUTH_ONLY)
|
||||
qt5_use_modules(${synclib_NAME} Network Xml Sql)
|
||||
else()
|
||||
qt5_use_modules(${synclib_NAME} Widgets Network Xml WebKitWidgets Sql)
|
||||
endif()
|
||||
|
||||
set_target_properties( ${synclib_NAME} PROPERTIES
|
||||
VERSION ${MIRALL_VERSION}
|
||||
@ -207,15 +211,15 @@ set_target_properties( ${synclib_NAME} PROPERTIES
|
||||
target_link_libraries(${synclib_NAME} ${libsync_LINK_TARGETS} )
|
||||
|
||||
if(BUILD_LIBRARIES_ONLY)
|
||||
add_library(${synclib_NAME}_static STATIC ${libsync_SRCS} ${syncMoc})
|
||||
qt5_use_modules(${synclib_NAME}_static Widgets Network Xml WebKitWidgets Sql)
|
||||
#add_library(${synclib_NAME}_static STATIC ${libsync_SRCS} ${syncMoc})
|
||||
#qt5_use_modules(${synclib_NAME}_static Widgets Network Xml Sql)
|
||||
|
||||
set_target_properties( ${synclib_NAME}_static PROPERTIES
|
||||
VERSION ${MIRALL_VERSION}
|
||||
SOVERSION ${MIRALL_SOVERSION}
|
||||
)
|
||||
#set_target_properties( ${synclib_NAME}_static PROPERTIES
|
||||
# VERSION ${MIRALL_VERSION}
|
||||
# SOVERSION ${MIRALL_SOVERSION}
|
||||
#)
|
||||
|
||||
target_link_libraries(${synclib_NAME}_static ${libsync_LINK_TARGETS} )
|
||||
#target_link_libraries(${synclib_NAME}_static ${libsync_LINK_TARGETS} )
|
||||
endif()
|
||||
|
||||
|
||||
@ -420,11 +424,11 @@ elseif(NOT BUILD_LIBRARIES_ONLY)
|
||||
install(FILES ${qtkeychain_I18N} DESTINATION ${QM_DIR})
|
||||
endif()
|
||||
|
||||
add_library(updater STATIC ${updater_SRCS} ${updaterMoc})
|
||||
target_link_libraries(updater ${synclib_NAME})
|
||||
qt5_use_modules(updater Widgets Network Xml)
|
||||
|
||||
if(NOT BUILD_LIBRARIES_ONLY)
|
||||
add_library(updater STATIC ${updater_SRCS} ${updaterMoc})
|
||||
target_link_libraries(updater ${synclib_NAME})
|
||||
qt5_use_modules(updater Widgets Network Xml)
|
||||
|
||||
set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY}
|
||||
)
|
||||
|
||||
@ -17,8 +17,6 @@
|
||||
#include <QDebug>
|
||||
#include <QNetworkReply>
|
||||
#include <QSettings>
|
||||
#include <QInputDialog>
|
||||
|
||||
|
||||
#include "mirall/account.h"
|
||||
#include "mirall/mirallaccessmanager.h"
|
||||
@ -179,17 +177,7 @@ bool TokenCredentials::stillValid(QNetworkReply *reply)
|
||||
|
||||
QString TokenCredentials::queryPassword(bool *ok)
|
||||
{
|
||||
qDebug() << AccountManager::instance()->account()->state();
|
||||
if (ok) {
|
||||
QString str = QInputDialog::getText(0, tr("Enter Password"),
|
||||
tr("Please enter %1 password for user '%2':")
|
||||
.arg(Theme::instance()->appNameGUI(), _user),
|
||||
QLineEdit::Password, QString(), ok);
|
||||
qDebug() << AccountManager::instance()->account()->state();
|
||||
return str;
|
||||
} else {
|
||||
return QString();
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
void TokenCredentials::invalidateToken(Account *account)
|
||||
|
||||
@ -49,8 +49,11 @@ CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype);
|
||||
#include <QTimer>
|
||||
#include <QUrl>
|
||||
#include <QDir>
|
||||
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#endif
|
||||
|
||||
namespace Mirall {
|
||||
|
||||
@ -672,6 +675,7 @@ void Folder::slotTransmissionProgress(const Progress::Info &pi)
|
||||
|
||||
void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction direction, bool *cancel)
|
||||
{
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
QString msg = direction == SyncFileItem::Down ?
|
||||
tr("This sync would remove all the files in the local sync folder '%1'.\n"
|
||||
"If you or your administrator have reset your account on the server, choose "
|
||||
@ -692,6 +696,7 @@ void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction direction, bool *
|
||||
if (*cancel) {
|
||||
wipe();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
SyncFileStatus Folder::fileStatus( const QString& fileName )
|
||||
|
||||
@ -27,8 +27,10 @@
|
||||
#include <shlobj.h>
|
||||
#endif
|
||||
|
||||
#include <QDesktopServices>
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
#include <QMessageBox>
|
||||
#endif
|
||||
|
||||
#include <QtCore>
|
||||
|
||||
namespace Mirall {
|
||||
@ -163,7 +165,8 @@ int FolderMan::setupFolders()
|
||||
|
||||
bool FolderMan::ensureJournalGone(const QString &localPath)
|
||||
{
|
||||
|
||||
// FIXME move this to UI, not libowncloudsync
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
// remove old .csync_journal file
|
||||
QString stateDbFile = localPath+QLatin1String("/.csync_journal.db");
|
||||
while (QFile::exists(stateDbFile) && !QFile::remove(stateDbFile)) {
|
||||
@ -177,6 +180,7 @@ bool FolderMan::ensureJournalGone(const QString &localPath)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -22,7 +22,11 @@
|
||||
#include "creds/abstractcredentials.h"
|
||||
#include "creds/credentialsfactory.h"
|
||||
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
#include <QWidget>
|
||||
#include <QHeaderView>
|
||||
#endif
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
@ -30,7 +34,6 @@
|
||||
#include <QSettings>
|
||||
#include <QDebug>
|
||||
#include <QNetworkProxy>
|
||||
#include <QHeaderView>
|
||||
|
||||
#define DEFAULT_REMOTE_POLL_INTERVAL 30000 // default remote poll time in milliseconds
|
||||
#define DEFAULT_MAX_LOG_LINES 20000
|
||||
@ -109,20 +112,25 @@ void MirallConfigFile::setOptionalDesktopNotifications(bool show)
|
||||
|
||||
void MirallConfigFile::saveGeometry(QWidget *w)
|
||||
{
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
Q_ASSERT(!w->objectName().isNull());
|
||||
QSettings settings(configFile(), QSettings::IniFormat);
|
||||
settings.beginGroup(w->objectName());
|
||||
settings.setValue(QLatin1String(geometryC), w->saveGeometry());
|
||||
settings.sync();
|
||||
#endif
|
||||
}
|
||||
|
||||
void MirallConfigFile::restoreGeometry(QWidget *w)
|
||||
{
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
w->restoreGeometry(getValue(geometryC, w->objectName()).toByteArray());
|
||||
#endif
|
||||
}
|
||||
|
||||
void MirallConfigFile::saveGeometryHeader(QHeaderView *header)
|
||||
{
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
if(!header) return;
|
||||
Q_ASSERT(!header->objectName().isNull());
|
||||
|
||||
@ -130,16 +138,19 @@ void MirallConfigFile::saveGeometryHeader(QHeaderView *header)
|
||||
settings.beginGroup(header->objectName());
|
||||
settings.setValue(QLatin1String(geometryC), header->saveState());
|
||||
settings.sync();
|
||||
#endif
|
||||
}
|
||||
|
||||
void MirallConfigFile::restoreGeometryHeader(QHeaderView *header)
|
||||
{
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
if(!header) return;
|
||||
Q_ASSERT(!header->objectName().isNull());
|
||||
|
||||
QSettings settings(configFile(), QSettings::IniFormat);
|
||||
settings.beginGroup(header->objectName());
|
||||
header->restoreState(getValue(geometryC, header->objectName()).toByteArray());
|
||||
#endif
|
||||
}
|
||||
|
||||
QVariant MirallConfigFile::getPolicySetting(const QString &setting, const QVariant& defaultValue) const
|
||||
|
||||
@ -16,10 +16,13 @@
|
||||
|
||||
#include <QString>
|
||||
#include <QVariant>
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
#include <QPixmap>
|
||||
#include <QIcon>
|
||||
#include <QStyle>
|
||||
#include <QApplication>
|
||||
#endif
|
||||
#include <QCoreApplication>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
@ -66,6 +69,7 @@ QString ownCloudTheme::about() const
|
||||
|
||||
}
|
||||
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
QIcon ownCloudTheme::trayFolderIcon( const QString& ) const
|
||||
{
|
||||
QPixmap fallback = qApp->style()->standardPixmap(QStyle::SP_FileDialogNewFolder);
|
||||
@ -83,6 +87,8 @@ QIcon ownCloudTheme::applicationIcon( ) const
|
||||
return themeIcon( QLatin1String("owncloud-icon") );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
QVariant ownCloudTheme::customMedia(Theme::CustomMediaType type)
|
||||
{
|
||||
if (type == Theme::oCSetupTop) {
|
||||
@ -100,6 +106,7 @@ QString ownCloudTheme::helpUrl() const
|
||||
return QString::fromLatin1("http://doc.owncloud.org/desktop/%1.%2/").arg(MIRALL_VERSION_MAJOR).arg(MIRALL_VERSION_MINOR);
|
||||
}
|
||||
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
QColor ownCloudTheme::wizardHeaderBackgroundColor() const
|
||||
{
|
||||
return QColor("#1d2d42");
|
||||
@ -114,7 +121,7 @@ QPixmap ownCloudTheme::wizardHeaderLogo() const
|
||||
{
|
||||
return QPixmap(":/mirall/theme/colored/wizard_logo.png");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -39,7 +39,6 @@
|
||||
#include <QStringList>
|
||||
#include <QTextStream>
|
||||
#include <QTime>
|
||||
#include <QApplication>
|
||||
#include <QUrl>
|
||||
#include <QSslCertificate>
|
||||
|
||||
|
||||
@ -17,7 +17,9 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <QtCore>
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
#include <QtGui>
|
||||
#endif
|
||||
|
||||
#include "mirall/owncloudtheme.h"
|
||||
|
||||
@ -96,6 +98,8 @@ QString Theme::version() const
|
||||
return QString::fromLocal8Bit( MIRALL_STRINGIFY( MIRALL_VERSION ));
|
||||
}
|
||||
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
|
||||
QIcon Theme::trayFolderIcon( const QString& backend ) const
|
||||
{
|
||||
Q_UNUSED(backend)
|
||||
@ -147,6 +151,7 @@ QIcon Theme::themeIcon( const QString& name, bool sysTray ) const
|
||||
}
|
||||
return icon;
|
||||
}
|
||||
#endif
|
||||
|
||||
// if this option return true, the client only supports one folder to sync.
|
||||
// The Add-Button is removed accoringly.
|
||||
@ -211,6 +216,7 @@ QString Theme::about() const
|
||||
.arg(MIRALL_STRINGIFY(APPLICATION_DOMAIN)).arg(APPLICATION_VENDOR).arg(APPLICATION_NAME);
|
||||
}
|
||||
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
QVariant Theme::customMedia( CustomMediaType type )
|
||||
{
|
||||
QVariant re;
|
||||
@ -305,6 +311,7 @@ QPixmap Theme::wizardHeaderBanner() const
|
||||
pix.fill(wizardHeaderBackgroundColor());
|
||||
return pix;
|
||||
}
|
||||
#endif
|
||||
|
||||
} // end namespace mirall
|
||||
|
||||
|
||||
@ -79,6 +79,7 @@ public:
|
||||
*/
|
||||
virtual QString configFileName() const = 0;
|
||||
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
/**
|
||||
* the icon that is shown in the tray context menu left of the folder name
|
||||
*/
|
||||
@ -91,6 +92,7 @@ public:
|
||||
|
||||
virtual QIcon folderDisabledIcon() const = 0;
|
||||
virtual QIcon applicationIcon() const = 0;
|
||||
#endif
|
||||
|
||||
virtual QString statusHeaderText( SyncResult::Status ) const;
|
||||
virtual QString version() const;
|
||||
@ -130,6 +132,7 @@ public:
|
||||
/** colored, white or black */
|
||||
QString systrayIconFlavor(bool mono) const;
|
||||
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
/**
|
||||
* Override to use a string or a custom image name.
|
||||
* The default implementation will try to look up
|
||||
@ -154,6 +157,7 @@ public:
|
||||
* @return banner for the setup wizard.
|
||||
*/
|
||||
virtual QPixmap wizardHeaderBanner() const;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* About dialog contents
|
||||
|
||||
@ -22,16 +22,19 @@
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QUrl>
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
#include <QWidget>
|
||||
#endif
|
||||
#include <QDebug>
|
||||
#include <QDesktopServices>
|
||||
#include <QProcess>
|
||||
#include <QThread>
|
||||
#include <QDateTime>
|
||||
#include <QSysInfo>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
#include <QDesktopServices>
|
||||
#endif
|
||||
#include <QTextDocument>
|
||||
#else
|
||||
#include <QStandardPaths>
|
||||
@ -165,6 +168,7 @@ QByteArray Utility::userAgentString()
|
||||
|
||||
void Utility::raiseDialog( QWidget *raiseWidget )
|
||||
{
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
// viel hilft viel ;-)
|
||||
if( raiseWidget ) {
|
||||
#if defined(Q_OS_WIN) || defined (Q_OS_MAC)
|
||||
@ -181,6 +185,7 @@ void Utility::raiseDialog( QWidget *raiseWidget )
|
||||
raiseWidget->raise();
|
||||
raiseWidget->activateWindow();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Utility::hasLaunchOnStartup(const QString &appName)
|
||||
@ -261,7 +266,11 @@ QString Utility::dataLocation()
|
||||
{
|
||||
// Qt 5's QStandardPaths::writableLocation gives us wrong results (without /data/),
|
||||
// so we'll have to use the deprecated version for now
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
return QDesktopServices::storageLocation(QDesktopServices::DataLocation);
|
||||
#else
|
||||
return QString();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
||||
@ -435,7 +444,9 @@ void Utility::showInFileManager(const QString &localPath)
|
||||
|
||||
if (app.isEmpty() || args.isEmpty() || !canHandleFile) {
|
||||
// fall back: open the default file manager, without ever selecting the file
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(pathToOpen));
|
||||
#endif
|
||||
} else {
|
||||
QProcess::startDetached(app, args);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user