Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOneRing committed Jul 15, 2020
1 parent cbcaeb9 commit bcf9f31
Show file tree
Hide file tree
Showing 25 changed files with 51 additions and 1,753 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "src/3rdparty/libcrashreporter-qt"]
path = src/3rdparty/libcrashreporter-qt
url = git://github.com/dschmidt/libcrashreporter-qt.git
[submodule "src/3rdparty/zsync"]
path = src/3rdparty/zsync
url = https://github.com/owncloud/zsync
1 change: 0 additions & 1 deletion src/3rdparty/zsync
Submodule zsync deleted from 302dfb
10 changes: 0 additions & 10 deletions src/cmd/cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,6 @@ void help()
std::cout << " --max-sync-retries [n] Retries maximum n times (default to 3)" << std::endl;
std::cout << " --uplimit [n] Limit the upload speed of files to n KB/s" << std::endl;
std::cout << " --downlimit [n] Limit the download speed of files to n KB/s" << std::endl;
std::cout << " --deltasync, -ds Enable delta sync (disabled by default)" << std::endl;
std::cout << " --deltasyncmin [n] Set delta sync minimum file size to n MB (10 MiB default)" << std::endl;
std::cout << " -h Sync hidden files,do not ignore them" << std::endl;
std::cout << " --version, -v Display version and exit" << std::endl;
std::cout << " --logdebug More verbose logging" << std::endl;
Expand Down Expand Up @@ -277,10 +275,6 @@ void parseOptions(const QStringList &app_args, CmdOptions *options)
options->uplimit = it.next().toInt() * 1000;
} else if (option == "--downlimit" && !it.peekNext().startsWith("-")) {
options->downlimit = it.next().toInt() * 1000;
} else if (option == "-ds" || option == "--deltasync") {
options->deltasync = true;
} else if (option == "--deltasyncmin" && !it.peekNext().startsWith("-")) {
options->deltasyncminfilesize = it.next().toLongLong() * 1024 * 1024;
} else if (option == "--logdebug") {
Logger::instance()->setLogFile("-");
Logger::instance()->setLogDebug(true);
Expand Down Expand Up @@ -340,8 +334,6 @@ int main(int argc, char **argv)
options.restartTimes = 3;
options.uplimit = 0;
options.downlimit = 0;
options.deltasync = false;
options.deltasyncminfilesize = 10 * 1024 * 1024;

parseOptions(app.arguments(), &options);

Expand Down Expand Up @@ -542,8 +534,6 @@ int main(int argc, char **argv)
SyncOptions opt;
opt.fillFromEnvironmentVariables();
opt.verifyChunkSizes();
opt._deltaSyncEnabled = options.deltasync;
opt._deltaSyncMinFileSize = options.deltasyncminfilesize;
SyncEngine engine(account, options.source_dir, folder, &db);
engine.setSyncOptions(opt);
engine.setIgnoreHiddenFiles(options.ignoreHiddenFiles);
Expand Down
4 changes: 2 additions & 2 deletions src/common/remotepermissions.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ class OCSYNC_EXPORT RemotePermissions
IsShared = 8, // S
IsMounted = 9, // M
IsMountedSub = 10, // m (internal: set if the parent dir has IsMounted)
HasZSyncMetadata = 11, // z (internal: set if remote file has zsync metadata property set)
DeprecatedRemoved = 11, // z (Deprecated, don't use)

// Note: when adding support for more permissions, we need to invalid the cache in the database.
// (by setting forceRemoteDiscovery in SyncJournalDb::checkConnect)
PermissionsCount = HasZSyncMetadata
PermissionsCount = DeprecatedRemoved
};

/// null permissions
Expand Down
3 changes: 0 additions & 3 deletions src/gui/folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,9 +865,6 @@ void Folder::setSyncOptions()
opt._maxChunkSize = cfgFile.maxChunkSize();
opt._targetChunkUploadDuration = cfgFile.targetChunkUploadDuration();

opt._deltaSyncEnabled = cfgFile.deltaSyncEnabled();
opt._deltaSyncMinFileSize = cfgFile.deltaSyncMinFileSize();

opt.fillFromEnvironmentVariables();
opt.verifyChunkSizes();

Expand Down
9 changes: 0 additions & 9 deletions src/gui/generalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ GeneralSettings::GeneralSettings(QWidget *parent)
connect(_ui->newFolderLimitCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings);
connect(_ui->newFolderLimitSpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &GeneralSettings::saveMiscSettings);
connect(_ui->newExternalStorage, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings);
connect(_ui->deltaSyncCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings);
connect(_ui->deltaSyncSpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &GeneralSettings::saveMiscSettings);

#ifndef WITH_CRASHREPORTER
_ui->crashreporterCheckBox->setVisible(false);
Expand Down Expand Up @@ -100,9 +98,6 @@ GeneralSettings::GeneralSettings(QWidget *parent)
_ui->updateChannel->hide();
#endif
}
if (!theme->enableExperimentalFeatures()) {
_ui->experimentalGroupBox->hide();
}

_ui->versionLabel->setText(QStringLiteral("<a href='%1'>%1</a>").arg(MIRALL_VERSION_STRING));
QObject::connect(_ui->versionLabel, &QLabel::linkActivated, this, &GeneralSettings::showAbout);
Expand Down Expand Up @@ -131,8 +126,6 @@ void GeneralSettings::loadMiscSettings()
_ui->newFolderLimitSpinBox->setValue(newFolderLimit.second);
_ui->newExternalStorage->setChecked(cfgFile.confirmExternalStorage());
_ui->monoIconsCheckBox->setChecked(cfgFile.monoIcons());
_ui->deltaSyncCheckBox->setChecked(cfgFile.deltaSyncEnabled());
_ui->deltaSyncSpinBox->setValue(cfgFile.deltaSyncMinFileSize() / (1024 * 1024));
}

void GeneralSettings::showEvent(QShowEvent *)
Expand Down Expand Up @@ -230,8 +223,6 @@ void GeneralSettings::saveMiscSettings()
cfgFile.setNewBigFolderSizeLimit(_ui->newFolderLimitCheckBox->isChecked(),
_ui->newFolderLimitSpinBox->value());
cfgFile.setConfirmExternalStorage(_ui->newExternalStorage->isChecked());
cfgFile.setDeltaSyncEnabled(_ui->deltaSyncCheckBox->isChecked());
cfgFile.setDeltaSyncMinFileSize(_ui->deltaSyncSpinBox->value() * 1024 * 1024);
}

void GeneralSettings::slotToggleLaunchOnStartup(bool enable)
Expand Down
49 changes: 0 additions & 49 deletions src/gui/generalsettings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -163,53 +163,6 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="experimentalGroupBox">
<property name="title">
<string>Experimental</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="deltaSyncCheckBox">
<property name="text">
<string>Enable Delta-Synchronization for files larger than</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="deltaSyncSpinBox">
<property name="maximum">
<number>999999</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>MB</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="versionGroupBox">
<property name="title">
Expand Down Expand Up @@ -410,8 +363,6 @@
<tabstop>newExternalStorage</tabstop>
<tabstop>showInExplorerNavigationPaneCheckBox</tabstop>
<tabstop>crashreporterCheckBox</tabstop>
<tabstop>deltaSyncCheckBox</tabstop>
<tabstop>deltaSyncSpinBox</tabstop>
<tabstop>updateChannel</tabstop>
<tabstop>restartButton</tabstop>
</tabstops>
Expand Down
32 changes: 0 additions & 32 deletions src/libsync/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ set(libsync_SRCS
owncloudtheme.cpp
progressdispatcher.cpp
propagatorjobs.cpp
propagatecommonzsync.cpp
propagatedownload.cpp
propagatedownloadzsync.cpp
propagateupload.cpp
propagateuploadv1.cpp
propagateuploadng.cpp
Expand All @@ -45,35 +43,6 @@ else()
set (libsync_SRCS ${libsync_SRCS} creds/httpcredentials.cpp)
endif()

## begin zsync

add_library(zsync STATIC ../3rdparty/zsync/c/librcksum/hash.c
../3rdparty/zsync/c/librcksum/md4.c
../3rdparty/zsync/c/librcksum/range.c
../3rdparty/zsync/c/librcksum/rsum.c
../3rdparty/zsync/c/librcksum/state.c
../3rdparty/zsync/c/libzsync/sha1.c
../3rdparty/zsync/c/libzsync/zsync.c
../3rdparty/zsync/c/libzsync/zsyncfile.c
../3rdparty/zsync/c/progress.c
)

set_target_properties(zsync PROPERTIES C_STANDARD 11 AUTOMOC OFF)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
target_compile_options(zsync PRIVATE -Wno-unused-parameter -Wno-unused-function)
endif()
target_include_directories(zsync PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/3rdparty/zsync/c>)

if ( WIN32 )
target_link_libraries(zsync PUBLIC ws2_32)
# ensure size_t is 64 bits
target_compile_definitions(zsync PRIVATE _FILE_OFFSET_BITS=64)
endif()

target_compile_definitions(zsync PRIVATE VERSION="0.6.3" SIZEOF_OFF_T=8)

## end zsync

# These headers are installed for libowncloudsync to be used by 3rd party apps
set(owncloudsync_HEADERS
account.h
Expand Down Expand Up @@ -105,7 +74,6 @@ add_library(${synclib_NAME} SHARED ${libsync_SRCS})
target_link_libraries(${synclib_NAME} PUBLIC
"${csync_NAME}"
Qt5::Core Qt5::Network
zsync
)

if ( APPLE )
Expand Down
5 changes: 0 additions & 5 deletions src/libsync/capabilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,6 @@ bool Capabilities::versioningEnabled() const
return _capabilities.value("files").toMap().value("versioning").toBool();
}

QString Capabilities::zsyncSupportedVersion() const
{
return _capabilities[QStringLiteral("dav")].toMap()[QStringLiteral("zsync")].toString();
}

QStringList Capabilities::blacklistedFiles() const
{
return _capabilities.value("files").toMap().value("blacklisted_files").toStringList();
Expand Down
1 change: 0 additions & 1 deletion src/libsync/capabilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ class OWNCLOUDSYNC_EXPORT Capabilities
int defaultPermissions() const;

bool chunkingNg() const;
QString zsyncSupportedVersion() const;

/// Wheter to use chunking
bool bigfilechunkingEnabled() const;
Expand Down
25 changes: 0 additions & 25 deletions src/libsync/configfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ static const char useNewBigFolderSizeLimitC[] = "useNewBigFolderSizeLimit";
static const char confirmExternalStorageC[] = "confirmExternalStorage";
static const char moveToTrashC[] = "moveToTrash";

static const char deltaSyncEnabledC[] = "DeltaSync/enabled";
static const char deltaSyncMinimumFileSizeC[] = "DeltaSync/minFileSize";

const char certPath[] = "http_certificatePath";
const char certPasswd[] = "http_certificatePasswd";
QString ConfigFile::_confDir = QString();
Expand Down Expand Up @@ -734,28 +731,6 @@ void ConfigFile::setMoveToTrash(bool isChecked)
setValue(moveToTrashC, isChecked);
}

bool ConfigFile::deltaSyncEnabled() const
{
QSettings settings(configFile(), QSettings::IniFormat);
return settings.value(QLatin1String(deltaSyncEnabledC), false).toBool(); // default to false
}

void ConfigFile::setDeltaSyncEnabled(bool enabled)
{
setValue(deltaSyncEnabledC, enabled);
}

qint64 ConfigFile::deltaSyncMinFileSize() const
{
QSettings settings(configFile(), QSettings::IniFormat);
return settings.value(QLatin1String(deltaSyncMinimumFileSizeC), 10 * 1024 * 1024).toLongLong(); // default to 10 MiB
}

void ConfigFile::setDeltaSyncMinFileSize(qint64 bytes)
{
setValue(deltaSyncMinimumFileSizeC, bytes);
}

bool ConfigFile::promptDeleteFiles() const
{
QSettings settings(configFile(), QSettings::IniFormat);
Expand Down
6 changes: 0 additions & 6 deletions src/libsync/configfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,6 @@ class OWNCLOUDSYNC_EXPORT ConfigFile
void setNewBigFolderSizeLimit(bool isChecked, qint64 mbytes);
bool confirmExternalStorage() const;
void setConfirmExternalStorage(bool);
/** delta sync */
bool deltaSyncEnabled() const;
void setDeltaSyncEnabled(bool enabled);
qint64 deltaSyncMinFileSize() const; // bytes
void setDeltaSyncMinFileSize(qint64 bytes);


/** If we should move the files deleted on the server in the trash */
bool moveToTrash() const;
Expand Down
11 changes: 1 addition & 10 deletions src/libsync/discoveryphase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,7 @@ void DiscoverySingleDirectoryJob::start()
<< "http://owncloud.org/ns:downloadURL"
<< "http://owncloud.org/ns:dDC"
<< "http://owncloud.org/ns:permissions"
<< "http://owncloud.org/ns:checksums"
<< "http://owncloud.org/ns:zsync";
<< "http://owncloud.org/ns:checksums";
if (_isRootPath)
props << "http://owncloud.org/ns:data-fingerprint";
if (_account->serverVersionInt() >= Account::makeServerVersion(10, 0, 0)) {
Expand Down Expand Up @@ -406,14 +405,6 @@ static void propertyMapToRemoteInfo(const QMap<QString, QString> &map, RemoteInf
// Piggy back on the persmission field
result.remotePerm.setPermission(RemotePermissions::IsShared);
}
} else if (property == "zsync" && value.toUtf8() == "true") {
// Since QMap is sorted, "zsync" is always after "permissions".
if (result.remotePerm.isNull()) {
qWarning() << "Server returned no permissions";
// Empty permissions will cause a sync failure
} else {
result.remotePerm.setPermission(RemotePermissions::HasZSyncMetadata);
}
}
}
}
Expand Down
4 changes: 0 additions & 4 deletions src/libsync/progressdispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ class OWNCLOUDSYNC_EXPORT ProgressInfo : public QObject
* This function is called at most once per item during propagation
* to adjust them when its actual size has been determined.
*
* Example: With delta-sync, the actual size of the download will only
* be known during propagation - this function adjusts the total size
* to account for it.
*
* The value in item.size must be the same as during the call to
* adjustTotalsForFile() while newSize is the newly determined actual
* size.
Expand Down
Loading

0 comments on commit bcf9f31

Please sign in to comment.