set( SOCKETAPI_TEAM_IDENTIFIER_PREFIX "" CACHE STRING "SocketApi prefix (including a following dot) that must match the codesign key's TeamIdentifier/Organizational Unit" )
endif()
+set(OWNCLOUD_PLACEHOLDER_SUFFIX ".owncloud" CACHE STRING "Placeholder suffix (must start with a .)")
+
if(BUILD_CLIENT)
if(APPLE AND BUILD_UPDATER)
find_package(Sparkle)
#cmakedefine APPLICATION_WIZARD_HEADER_BACKGROUND_COLOR "@APPLICATION_WIZARD_HEADER_BACKGROUND_COLOR@"
#cmakedefine APPLICATION_WIZARD_HEADER_TITLE_COLOR "@APPLICATION_WIZARD_HEADER_TITLE_COLOR@"
#cmakedefine APPLICATION_WIZARD_USE_CUSTOM_LOGO "@APPLICATION_WIZARD_USE_CUSTOM_LOGO@"
+#cmakedefine OWNCLOUD_PLACEHOLDER_SUFFIX "@OWNCLOUD_PLACEHOLDER_SUFFIX@"
#cmakedefine ZLIB_FOUND @ZLIB_FOUND@
Icon=@APPLICATION_ICON_NAME@
Keywords=@APPLICATION_NAME@;syncing;file;sharing;
X-GNOME-Autostart-Delay=3
-MimeType=application/x-owncloud
+MimeType=application/x-@APPLICATION_EXECUTABLE@
# Translations
/**
* The suffix to use for placeholder files.
*/
- QByteArray placeholder_suffix = ".owncloud";
+ QByteArray placeholder_suffix;
csync_s(const char *localUri, OCC::SyncJournalDb *statedb);
~csync_s();
${CMAKE_CURRENT_BINARY_DIR}/${LINUX_APPLICATION_ID}.desktop)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LINUX_APPLICATION_ID}.desktop DESTINATION ${DATADIR}/applications )
- #FIXME! branding
- install(FILES owncloud.xml DESTINATION ${DATADIR}/mime/packages )
+ configure_file(owncloud.xml.in ${APPLICATION_EXECUTABLE}.xml)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_EXECUTABLE}.xml DESTINATION ${DATADIR}/mime/packages )
find_package(ECM 1.2.0 CONFIG)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
_backgroundMode = true;
} else if (option == QLatin1String("--version") || option == QLatin1String("-v")) {
_versionOnly = true;
- } else if (option.endsWith(".owncloud")) {
+ } else if (option.endsWith(QStringLiteral(OWNCLOUD_PLACEHOLDER_SUFFIX))) {
// placeholder file, open it after the Folder were created (if the app is not terminated)
QTimer::singleShot(0, this, [this, option] { openPlaceholder(option); });
} else {
void Application::openPlaceholder(const QString &filename)
{
- QLatin1String placeholderExt(".owncloud");
+ QString placeholderExt = QStringLiteral(OWNCLOUD_PLACEHOLDER_SUFFIX);
if (!filename.endsWith(placeholderExt)) {
qWarning(lcApplication) << "Can only handle file ending in .owncloud. Unable to open" << filename;
return;
opt._confirmExternalStorage = cfgFile.confirmExternalStorage();
opt._moveFilesToTrash = cfgFile.moveToTrash();
opt._newFilesArePlaceholders = _definition.usePlaceholders;
+ opt._placeholderSuffix = QStringLiteral(OWNCLOUD_PLACEHOLDER_SUFFIX);
QByteArray chunkSizeEnv = qgetenv("OWNCLOUD_CHUNK_SIZE");
if (!chunkSizeEnv.isEmpty()) {
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
- <mime-type type="application/x-owncloud">
- <comment>ownCloud placeholder style</comment>
- <glob pattern="*.owncloud"/>
- </mime-type>
-</mime-info>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
+ <mime-type type="application/x-@APPLICATION_EXECUTABLE@">
+ <comment>@APPLICATION_NAME@ placeholders</comment>
+ <glob pattern="*@OWNCLOUD_PLACEHOLDER_SUFFIX@"/>
+ </mime-type>
+</mime-info>
return _localDir + tmp_file_name;
}
-QString OwncloudPropagator::placeholderFilePath(const QString &fileName) const
+QString OwncloudPropagator::addPlaceholderSuffix(const QString &fileName) const
{
- return getFilePath(fileName) + QLatin1String(".owncloud");
+ return fileName + _syncOptions._placeholderSuffix;
}
void OwncloudPropagator::scheduleNextJob()
/* returns the local file path for the given tmp_file_name */
QString getFilePath(const QString &tmp_file_name) const;
- QString placeholderFilePath(const QString &fileName) const;
+ QString addPlaceholderSuffix(const QString &fileName) const;
/** Creates the job for an item.
*/
// If we want to download something that used to be a placeholder,
// wipe the placeholder and proceed with a normal download
if (_item->_type == ItemTypePlaceholderDownload) {
- auto fn = propagator()->placeholderFilePath(_item->_file);
+ auto placeholder = propagator()->addPlaceholderSuffix(_item->_file);
+ auto fn = propagator()->getFilePath(placeholder);
qCDebug(lcPropagateDownload) << "Downloading file that used to be a placeholder" << fn;
QFile::remove(fn);
- propagator()->_journal->deleteFileRecord(_item->_file + ".owncloud");
+ propagator()->_journal->deleteFileRecord(placeholder);
_item->_type = ItemTypeFile;
}
};
_csync_ctx->new_files_are_placeholders = _syncOptions._newFilesArePlaceholders;
+ _csync_ctx->placeholder_suffix = _syncOptions._placeholderSuffix.toUtf8();
// If needed, make sure we have up to date E2E information before the
// discovery phase, otherwise we start right away
/** Create a placeholder for new files instead of downloading */
bool _newFilesArePlaceholders = false;
+ QString _placeholderSuffix;
/** The initial un-adjusted chunk size in bytes for chunked uploads, both
* for old and new chunking algorithm, which classifies the item to be chunked