diff --git a/VERSION.cmake b/VERSION.cmake index e3214c26b0..e18bc8b343 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -1,6 +1,6 @@ set( MIRALL_VERSION_MAJOR 2 ) set( MIRALL_VERSION_MINOR 0 ) -set( MIRALL_VERSION_PATCH 1 ) +set( MIRALL_VERSION_PATCH 2 ) set( MIRALL_SOVERSION 0 ) if ( NOT DEFINED MIRALL_VERSION_SUFFIX ) diff --git a/csync/src/csync_exclude.c b/csync/src/csync_exclude.c index d5cee4368a..c673affb9c 100644 --- a/csync/src/csync_exclude.c +++ b/csync/src/csync_exclude.c @@ -268,23 +268,23 @@ static CSYNC_EXCLUDE_TYPE _csync_excluded_common(c_strlist_t *excludes, const ch c_strlist_t *path_components = c_strlist_new(32); char *path_split = strdup(path); size_t len = strlen(path_split); - for (int j = len; ; --j) { + for (i = len; ; --i) { // read backwards until a path separator is found - if (j != 0 && path_split[j-1] != '/') { + if (i != 0 && path_split[i-1] != '/') { continue; } // check 'basename', i.e. for "/foo/bar/fi" we'd check 'fi', 'bar', 'foo' - if (path_split[j] != 0) { - c_strlist_add_grow(&path_components, path_split + j); + if (path_split[i] != 0) { + c_strlist_add_grow(&path_components, path_split + i); } - if (j == 0 || !check_leading_dirs) { + if (i == 0 || !check_leading_dirs) { break; } // check 'dirname', i.e. for "/foo/bar/fi" we'd check '/foo/bar', '/foo' - path_split[j-1] = '\0'; + path_split[i-1] = '\0'; c_strlist_add_grow(&path_components, path_split); } SAFE_FREE(path_split); diff --git a/doc/building.rst b/doc/building.rst index 1cdd3958f4..5ee84d1257 100644 --- a/doc/building.rst +++ b/doc/building.rst @@ -1,5 +1,6 @@ .. _building-label: +=============================== Appendix A: Building the Client =============================== @@ -23,7 +24,7 @@ Linux * openSUSE: ``zypper ref; zypper si -d owncloud-client`` * Fedora/CentOS: ``yum install yum-utils; yum-builddep owncloud-client`` -3. Follow the `generic build instructions`_. +3. Follow the :ref:`generic-build-instructions`. 4. (Optional) Call ``make install`` to install the client to the ``/usr/local/bin`` directory. @@ -43,7 +44,7 @@ The tested and preferred way to develop in this environment is through the use of HomeBrew_. The ownCloud team has its own repository containing non-standard recipes. -To set up your build enviroment for development using HomeBrew_: +To set up your build environment for development using HomeBrew_: 1. Add the ownCloud repository using the following command:: @@ -60,7 +61,7 @@ To set up your build enviroment for development using HomeBrew_: Where ``x.z`` is the current version of Qt 5 that brew has installed on your machine. -5. For compilation of the client, follow the `generic build instructions`_. +5. For compilation of the client, follow the :ref:`generic-build-instructions`. 6. In the build directory, run ``admin/osx/create_mac.sh ``. If you have a developer signing certificate, you can specify @@ -118,14 +119,14 @@ follow `Windows Installer Build (Cross-Compile)`_ instead. cmake -G "MinGW Makefiles" ../client mingw32-make - .. note:: You can try using ninja to build parallelly using + .. note:: You can try using ninja to build in parallel using ``cmake -G Ninja ../client`` and ``ninja`` instead. - .. note:: Refer to the `generic build instructions`_ section for additional options. + .. note:: Refer to the :ref:`generic-build-instructions` section for additional options. - The owncloud binary will appear in the ``bin`` directory. + The ownCloud binary will appear in the ``bin`` directory. Windows Installer Build (Cross-Compile) ------------------------ +--------------------------------------- Due to the large number of dependencies, building the client installer for Windows is **currently only officially supported on openSUSE**, by using the MinGW cross compiler. @@ -149,7 +150,7 @@ To cross-compile: zypper install mingw32-cross-nsis mingw32-cross-nsis-plugin-uac mingw32-cross-nsis-plugin-nsprocess -4. Follow the `generic build instructions`_ +4. Follow the :ref:`generic-build-instructions` .. note:: When building for Windows platforms, you must specify a special toolchain file that enables cmake to locate the platform-specific tools. To add @@ -179,7 +180,8 @@ To cross-compile: you may use the official Microsoft ``signtool`` utility on Microsoft Windows. -.. _`generic build instructions`: +.. _generic-build-instructions: + Generic Build Instructions -------------------------- diff --git a/mirall.desktop.in b/mirall.desktop.in index 726b00a7f2..0c80a760eb 100644 --- a/mirall.desktop.in +++ b/mirall.desktop.in @@ -7,3 +7,4 @@ Comment=@APPLICATION_NAME@ desktop synchronization client GenericName=Folder Sync Icon=@APPLICATION_EXECUTABLE@ Keywords=@APPLICATION_NAME@;syncing;file;sharing; +X-GNOME-Autostart-Delay=3 diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index f523af4bb6..0327470731 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -62,7 +62,6 @@ set(client_SRCS sslerrordialog.cpp syncrunfilelog.cpp systray.cpp - accountmigrator.cpp quotainfo.cpp accountstate.cpp addcertificatedialog.cpp diff --git a/src/gui/accountmigrator.cpp b/src/gui/accountmigrator.cpp deleted file mode 100644 index 8d9a558aa8..0000000000 --- a/src/gui/accountmigrator.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) by Klaas Freitag - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - */ - -#include "accountmigrator.h" -#include "configfile.h" -#include "folderman.h" -#include "theme.h" - - -#include -#include -#include -#include -#include - -namespace OCC { - -// The purpose of this class is to migrate an existing account that -// was set up with an unbranded client to an branded one. -// The usecase is: Usually people try first with the community client, -// later they maybe switch to a branded client. When they install the -// branded client first, it should automatically pick the information -// from the already configured account. - -AccountMigrator::AccountMigrator() -{ - -} - -// the list of folder definitions which are files in the directory "folders" -// underneath the ownCloud configPath (with ownCloud as a last segment) -// need to be copied to the themed path and adjusted. - -QStringList AccountMigrator::migrateFolderDefinitons() -{ - ConfigFile cfg; - QStringList re; - - QString themePath = cfg.configPath(); - // create the original ownCloud config path out of the theme path - // by removing the theme folder and append ownCloud. - QString oCPath = themePath; - if( oCPath.endsWith(QLatin1Char('/')) ) { - oCPath.truncate( oCPath.length()-1 ); - } - oCPath = oCPath.left( oCPath.lastIndexOf('/')); - - themePath += QLatin1String( "folders"); - oCPath += QLatin1String( "/ownCloud/folders" ); - - qDebug() << "Migrator: theme-path: " << themePath; - qDebug() << "Migrator: ownCloud path: " << oCPath; - - // get a dir listing of the ownCloud folder definitions and copy - // them over to the theme dir - QDir oCDir(oCPath); - oCDir.setFilter( QDir::Files ); - QStringList files = oCDir.entryList(); - - foreach( const QString& file, files ) { - QString escapedAlias = FolderMan::instance()->escapeAlias(file); - QString themeFile = themePath + QDir::separator() + file; - QString oCFile = oCPath+QDir::separator()+file; - if( QFile::copy( oCFile, themeFile ) ) { - re.append(file); - qDebug() << "Migrator: Folder definition migrated: " << file; - - // fix the connection entry of the folder definition - QSettings settings(themeFile, QSettings::IniFormat); - settings.beginGroup( escapedAlias ); - settings.setValue(QLatin1String("connection"), Theme::instance()->appName()); - settings.sync(); - } - } - - return re; -} - -} diff --git a/src/gui/accountmigrator.h b/src/gui/accountmigrator.h deleted file mode 100644 index 7a023c700d..0000000000 --- a/src/gui/accountmigrator.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) by Klaas Freitag - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - */ - -#ifndef ACCOUNTMIGRATOR_H -#define ACCOUNTMIGRATOR_H - -#include - -namespace OCC { - -/** - * @brief The AccountSettings class - * @ingroup gui - */ -class AccountMigrator { - -public: - explicit AccountMigrator(); - - /** - * @brief migrateFolderDefinitons - migrate the folder definition files - * @return the list of migrated folder definitions - */ - QStringList migrateFolderDefinitons(); - -}; -} - -#endif // ACCOUNTMIGRATOR_H diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index 56377b41fc..de8baa3f77 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -121,7 +121,6 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent) : this, SLOT(slotUpdateQuota(qint64,qint64))); connect(ui->deleteButton, SIGNAL(clicked()) , this, SLOT(slotDeleteAccount())); - } void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos) @@ -287,9 +286,10 @@ void AccountSettings::slotResetCurrentFolder() QMessageBox::Yes|QMessageBox::No ); if( ret == QMessageBox::Yes ) { FolderMan *folderMan = FolderMan::instance(); - Folder *f = folderMan->folder(alias); - f->slotTerminateSync(); - f->wipe(); + if(Folder *f = folderMan->folder(alias)) { + f->slotTerminateSync(); + f->wipe(); + } folderMan->slotScheduleAllFolders(); } } @@ -409,16 +409,18 @@ void AccountSettings::slotUpdateQuota(qint64 total, qint64 used) ui->quotaProgressBar->setVisible(true); ui->quotaProgressBar->setEnabled(true); // workaround the label only accepting ints (which may be only 32 bit wide) - ui->quotaProgressBar->setMaximum(100); const double percent = used/(double)total*100; const int percentInt = qMin(qRound(percent), 100); ui->quotaProgressBar->setValue(percentInt); QString usedStr = Utility::octetsToString(used); QString totalStr = Utility::octetsToString(total); QString percentStr = Utility::compactFormatDouble(percent, 1); - ui->quotaInfoLabel->setText(tr("Storage space: %1 (%3%) of %2 in use").arg(usedStr, totalStr, percentStr)); + QString toolTip = tr("%1 (%3%) of %2 in use. Some folders, including network mounted or shared folders, might have different limits.").arg(usedStr, totalStr, percentStr); + ui->quotaInfoLabel->setText(tr("%1 of %2 in use").arg(usedStr, totalStr)); + ui->quotaInfoLabel->setToolTip(toolTip); + ui->quotaProgressBar->setToolTip(toolTip); } else { - ui->quotaProgressBar->setMaximum(0); + ui->quotaProgressBar->setVisible(false); ui->quotaInfoLabel->setText(tr("Currently there is no storage usage information available.")); } } diff --git a/src/gui/accountsettings.h b/src/gui/accountsettings.h index 5f4034cf76..c20c464dfa 100644 --- a/src/gui/accountsettings.h +++ b/src/gui/accountsettings.h @@ -92,7 +92,6 @@ private: QUrl _OCUrl; bool _wasDisabledBefore; AccountState *_accountState; - QLabel *_quotaLabel; QuotaInfo _quotaInfo; }; diff --git a/src/gui/accountsettings.ui b/src/gui/accountsettings.ui index c3921f1ff9..43bac5740a 100644 --- a/src/gui/accountsettings.ui +++ b/src/gui/accountsettings.ui @@ -15,23 +15,8 @@ - - - - 0 - 0 - - - - false - - - - - - true - - + + 0 @@ -45,73 +30,39 @@ 0 - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - Connected with <server> as <user> - - - true - - - true - - - - - - - - 0 - 0 - - - - Remove the account configuration from the client - - - Delete - - - - + + + + 0 + 0 + + + + + - + + + + 0 + 0 + + + + Connected with <server> as <user> + + + true + + + true + + + + + 0 @@ -119,41 +70,67 @@ - Some folders, including network mounted or shared folders, might have different limits. + Remove the account configuration from the client - Storage space: ... - - - true - - - - - - - false - - - - 16777215 - 7 - - - - 0 - - - -1 - - - false + Delete + + + + + + + 0 + 0 + + + + + + + Storage space: ... + + + false + + + + + + + false + + + + 0 + 0 + + + + + 16777215 + 7 + + + + 100 + + + -1 + + + false + + + + + diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 5b0f4b0c82..ea9056df13 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -441,9 +441,11 @@ void Folder::bubbleUpSyncResult() break; case CSYNC_INSTRUCTION_CONFLICT: case CSYNC_INSTRUCTION_SYNC: - updatedItems++; - if (!firstItemUpdated) - firstItemUpdated = item; + if (!item->_isDirectory) { + updatedItems++; + if (!firstItemUpdated) + firstItemUpdated = item; + } break; case CSYNC_INSTRUCTION_ERROR: qDebug() << "Got Instruction ERROR. " << _syncResult.errorString(); diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp index 1d949e5d36..3b18a9a1ce 100644 --- a/src/gui/folderman.cpp +++ b/src/gui/folderman.cpp @@ -19,7 +19,6 @@ #include "theme.h" #include "socketapi.h" #include "account.h" -#include "accountmigrator.h" #include "accountstate.h" #include "accountmanager.h" #include "filesystem.h" diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp index d21d25e3b3..e7f5705570 100644 --- a/src/gui/folderstatusmodel.cpp +++ b/src/gui/folderstatusmodel.cpp @@ -172,7 +172,10 @@ QVariant FolderStatusModel::data(const QModelIndex &index, int role) const case FolderStatusDelegate::FolderSyncPaused : return f->syncPaused(); case FolderStatusDelegate::FolderAccountConnected : return accountConnected; case Qt::ToolTipRole: - return Theme::instance()->statusHeaderText(f->syncResult().status()); + if ( accountConnected ) + return Theme::instance()->statusHeaderText(f->syncResult().status()); + else + return tr("Signed out"); case FolderStatusDelegate::FolderStatusIconRole: if ( accountConnected ) { auto theme = Theme::instance(); diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index d798bd8a4c..f00fd7ad38 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -111,9 +111,6 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) : QTimer::singleShot(1, this, SLOT(showFirstPage())); - QPushButton *closeButton = _ui->buttonBox->button(QDialogButtonBox::Close); - connect(closeButton, SIGNAL(clicked()), SLOT(accept())); - QAction *showLogWindow = new QAction(this); showLogWindow->setShortcut(QKeySequence("F12")); connect(showLogWindow, SIGNAL(triggered()), gui, SLOT(slotToggleLogBrowser())); diff --git a/src/gui/settingsdialog.ui b/src/gui/settingsdialog.ui index cdabf661f9..83590c23bf 100644 --- a/src/gui/settingsdialog.ui +++ b/src/gui/settingsdialog.ui @@ -6,8 +6,8 @@ 0 0 - 693 - 457 + 488 + 342 @@ -29,28 +29,6 @@ 0 - - - - - 0 - - - 0 - - - - - Qt::Horizontal - - - QDialogButtonBox::Close - - - - - -