Comparar commits

..

1 Commits

Autor SHA1 Mensagem Data
Daniel Molkentin b157f309ff Theming build fix: Icons need shortname 2013-09-20 23:15:04 +02:00
49 arquivos alterados com 245 adições e 598 exclusões
-38
Ver Arquivo
@@ -1,43 +1,5 @@
ChangeLog
=========
version 1.4.2 (release 2013-10-18 ), csync 0.90.4 required
* Do not show the warning icon in the tray (#944)
* Fix manual proxy support when switching (#1016)
* Add folder column to detailed sync protocol (#1037)
* Fix possible endless loop in inotify (#1041)
* Do not elide the progress text (#1049)
* Fix high CPU load (#1073)
* Reconnect if network is unavailable after startup (#1080)
* Ensure paused folder stays paused when syncing with more than one folder (#1083)
* Don't show desktop notification when the user doesn't want to (#1093)
* System tray: Avoid quick flickering up of the ok-icon for the sync prepare state
* Progress: Do not show progress if nothing is transmitted
* Progress: Show number of deletes.
version 1.4.1 (release 2013-09-24 ), csync 0.90.1 required
* Translation and documentation fixes.
* Fixed error display in settings/status dialog, displays multi
line error messages now correctly.
* Wait up to 30 secs before complaining about missing systray
Fixes bug #949
* Fixed utf8 issues with basic auth authentication, fixes bug #941
* Fixed remote folder selector, avoid recursive syncing, fixes bug #962
* Handle and display network problems at startup correctly.
* Enable and disable the folder watcher during syncs correctly.
* Fix setting of thread priority.
* Fixed file size display.
* Fixed various folder wizard issues, bug #992
* Made "Sync started" message optional, fixes bug #934
* Fixed shutdown, avoid crashed config on win32, fixes bug #945
* Pop up config wizard if no server url is configured, fixes bug #1018
* Settings: calculate sidebar width dynamically, fixes bug #1020
* Fixed a crash if sync folders were removed, fixes bug #713
* Do proper resync after network disconnect, fixes bug #1007
* Various minor code fixes
version 1.4.0 (release 2013-09-04 ), csync 0.90.0 required
* New Scheduler: Only sync when there are actual changes in the server
+1 -1
Ver Arquivo
@@ -1,6 +1,6 @@
set( VERSION_MAJOR 1 )
set( VERSION_MINOR 4 )
set( VERSION_PATCH 2 )
set( VERSION_PATCH 0 )
set( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX}")
set( SOVERSION 0 )
-1
Ver Arquivo
@@ -11,7 +11,6 @@
#cmakedefine APPLICATION_NAME "@APPLICATION_NAME@"
#cmakedefine APPLICATION_SHORTNAME "@APPLICATION_SHORTNAME@"
#cmakedefine APPLICATION_EXECUTABLE "@APPLICATION_EXECUTABLE@"
#cmakedefine SYSCONFDIR "@SYSCONFDIR@"
#cmakedefine DATADIR "@DATADIR@"
+1 -1
Ver Arquivo
@@ -22,7 +22,7 @@ if(SPHINX_FOUND)
add_custom_target(doc DEPENDS doc-html doc-man COMMENT "Building documentation...")
endif(WITH_DOC)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ocdoc/_shared_assets")
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ocdoc")
add_dependencies(doc doc-html-org)
add_dependencies(doc doc-html-com)
endif()
+1 -6
Ver Arquivo
@@ -36,14 +36,9 @@ its own repository which contains non-standard recipes. Add it with::
Next, install the missing dependencies::
brew install $(brew deps ocsync)
brew install $(brew deps ocsync)
brew install $(brew deps mirall)
bug:
iniparser is not provideed by $(brew deps ocsync)
fix with brew install iniparser
To build mirall and csync, follow the `generic build instructions`_.
.. note::
+1 -1
Ver Arquivo
@@ -64,7 +64,7 @@ release = '@VERSION@'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build','scripts/*']
exclude_patterns = ['_build']
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
+1 -1
Ver Arquivo
@@ -5,4 +5,4 @@ Exec=@APPLICATION_EXECUTABLE@
Name=@APPLICATION_NAME@ desktop sync client
GenericName=Folder Sync
Icon=@APPLICATION_EXECUTABLE@
Keywords=@APPLICATION_NAME@;syncing;file;sharing;
Keywords=@APPLICATION_NAME@;syncing;file;sharing
+4 -12
Ver Arquivo
@@ -254,15 +254,7 @@ set( final_src
include( AddAppIconMacro )
set(ownCloud_old ${ownCloud})
# set an icon_app_name. For historical reasons we can not use the
# application_shortname for ownCloud but must rather set it manually.
if ( EXISTS ${OEM_THEME_DIR}/OEM.cmake )
set(ICON_APP_NAME ${APPLICATION_SHORTNAME})
else()
set(ICON_APP_NAME "owncloud")
endif()
kde4_add_app_icon( ownCloud "${theme_dir}/colored/${ICON_APP_NAME}-icon*.png")
kde4_add_app_icon( ownCloud "${theme_dir}/colored/${APPLICATION_SHORTNAME}-icon*.png")
list(APPEND final_src ${ownCloud})
set(ownCloud ${ownCloud_old})
@@ -270,11 +262,11 @@ if(NOT BUILD_OWNCLOUD_OSX_BUNDLE)
set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
if(NOT WIN32)
file( GLOB _icons "${theme_dir}/colored/${ICON_APP_NAME}-icon-*.png" )
file( GLOB _icons "${theme_dir}/colored/${APPLICATION_SHORTNAME}-icon-*.png" )
foreach( _file ${_icons} )
string( REPLACE "${theme_dir}/colored/${ICON_APP_NAME}-icon-" "" _res ${_file} )
string( REPLACE "${theme_dir}/colored/${APPLICATION_SHORTNAME}-icon-" "" _res ${_file} )
string( REPLACE ".png" "" _res ${_res} )
install( FILES ${_file} RENAME ${ICON_APP_NAME}.png DESTINATION ${DATADIR}/icons/hicolor/${_res}x${_res}/apps )
install( FILES ${_file} RENAME ${APPLICATION_SHORTNAME}.png DESTINATION ${DATADIR}/icons/hicolor/${_res}x${_res}/apps )
endforeach( _file )
endif(NOT WIN32)
+28 -23
Ver Arquivo
@@ -67,25 +67,11 @@ int getauth(const char *prompt,
} // ns
class HttpCredentialsAccessManager : public MirallAccessManager {
public:
HttpCredentialsAccessManager(const HttpCredentials *cred, QObject* parent = 0)
: MirallAccessManager(parent), _cred(cred) {}
protected:
QNetworkReply *createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData) {
QByteArray credHash = QByteArray(_cred->user().toUtf8()+":"+_cred->password().toUtf8()).toBase64();
QNetworkRequest req(request);
req.setRawHeader(QByteArray("Authorization"), QByteArray("Basic ") + credHash);
return MirallAccessManager::createRequest(op, req, outgoingData);\
}
private:
const HttpCredentials *_cred;
};
HttpCredentials::HttpCredentials()
: _user(),
_password(),
_ready(false)
_ready(false),
_attempts()
{}
HttpCredentials::HttpCredentials(const QString& user, const QString& password)
@@ -148,7 +134,7 @@ QString HttpCredentials::password() const
QNetworkAccessManager* HttpCredentials::getQNAM() const
{
MirallAccessManager* qnam = new HttpCredentialsAccessManager(this);
MirallAccessManager* qnam = new MirallAccessManager;
connect( qnam, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)),
this, SLOT(slotAuthentication(QNetworkReply*,QAuthenticator*)));
@@ -194,12 +180,30 @@ void HttpCredentials::slotCredentialsFetched(bool ok)
void HttpCredentials::slotAuthentication(QNetworkReply* reply, QAuthenticator* authenticator)
{
Q_UNUSED(authenticator)
// we cannot use QAuthenticator, because it sends username and passwords with latin1
// instead of utf8 encoding. Instead, we send it manually. Thus, if we reach this signal,
// those credentials were invalid and we terminate.
qDebug() << "Stop request: Authentication failed for " << reply->url().toString();
reply->close();
if( !(authenticator && reply) ) return;
qDebug() << "Authenticating request for " << reply->url();
if (_attempts.contains(reply)) {
++_attempts[reply];
} else {
connect(reply, SIGNAL(finished()),
this, SLOT(slotReplyFinished()));
_attempts[reply] = 1;
}
// TODO: Replace it with something meaningful...
//if( reply->url().toString().startsWith( webdavUrl( _connection ) ) ) {
if (_attempts[reply] > 1) {
qDebug() << "Too many attempts to authenticate. Stop request.";
reply->close();
} else {
authenticator->setUser( _user );
authenticator->setPassword( _password );
}
//} else {
// qDebug() << "WRN: attempt to authenticate to different url - closing.";
// reply->close();
//}
}
void HttpCredentials::slotReplyFinished()
@@ -208,6 +212,7 @@ void HttpCredentials::slotReplyFinished()
disconnect(reply, SIGNAL(finished()),
this, SLOT(slotReplyFinished()));
_attempts.remove (reply);
}
} // ns Mirall
+1
Ver Arquivo
@@ -56,6 +56,7 @@ private:
QString _user;
QString _password;
bool _ready;
QMap<QNetworkReply*, int> _attempts;
};
} // ns Mirall
+7 -23
Ver Arquivo
@@ -14,20 +14,8 @@
#include "mirall/application.h"
#include "mirall/theme.h"
#include "mirall/utility.h"
#include <QMessageBox>
#include <QTimer>
void warnSystray()
{
QMessageBox::critical(0, qApp->translate("main.cpp", "System Tray not available"),
qApp->translate("main.cpp", "%1 requires on a working system tray. "
"If you are running XFCE, please follow "
"<a href=\"http://docs.xfce.org/xfce/xfce4-panel/systray\">these instructions</a>. "
"Otherwise, please install a system tray application such as 'trayer' and try again.")
.arg(Mirall::Theme::instance()->appNameGUI()));
}
int main(int argc, char **argv)
{
@@ -51,17 +39,13 @@ int main(int argc, char **argv)
}
return 0;
} else {
int attempts = 0;
forever {
if (!QSystemTrayIcon::isSystemTrayAvailable() && qgetenv("DESKTOP_SESSION") != "ubuntu") {
Mirall::Utility::sleep(1);
attempts++;
if (attempts < 30) continue;
} else {
break;
}
warnSystray();
break;
if (!QSystemTrayIcon::isSystemTrayAvailable() && qgetenv("DESKTOP_SESSION") != "ubuntu") {
QMessageBox::critical(0, qApp->translate("main.cpp", "System Tray not available"),
qApp->translate("main.cpp", "%1 requires on a working system tray. "
"If you are running XFCE, please follow "
"<a href=\"http://docs.xfce.org/xfce/xfce4-panel/systray\">these instructions</a>. "
"Otherwise, please install a system tray application such as 'trayer' and try again.")
.arg(Mirall::Theme::instance()->appNameGUI()));
}
}
return app.exec();
+31 -96
Ver Arquivo
@@ -35,8 +35,6 @@
#include <QMessageBox>
#include <QAction>
#include <QKeySequence>
#include <QIcon>
#include <QVariant>
namespace Mirall {
@@ -53,7 +51,7 @@ static const char progressBarStyleC[] =
AccountSettings::AccountSettings(QWidget *parent) :
QWidget(parent),
ui(new Ui::AccountSettings),
_wasDisabledBefore(false)
_item(0)
{
ui->setupUi(this);
@@ -207,9 +205,9 @@ void AccountSettings::buttonsSetEnabled()
ui->_ButtonInfo->setEnabled(isSelected);
}
void AccountSettings::setGeneralErrors( const QStringList& errors )
void AccountSettings::setListWidgetItem( QListWidgetItem *item )
{
_generalErrors = errors;
_item = item;
}
void AccountSettings::folderToModelItem( QStandardItem *item, Folder *f )
@@ -219,41 +217,33 @@ void AccountSettings::folderToModelItem( QStandardItem *item, Folder *f )
item->setData( f->nativePath(), FolderStatusDelegate::FolderPathRole );
item->setData( f->secondPath(), FolderStatusDelegate::FolderSecondPathRole );
item->setData( f->alias(), FolderStatusDelegate::FolderAliasRole );
item->setData( f->userSyncEnabled() && f->syncEnabled(), FolderStatusDelegate::FolderSyncEnabled );
item->setData( f->syncEnabled(), FolderStatusDelegate::FolderSyncEnabled );
SyncResult res = f->syncResult();
SyncResult::Status status = res.status();
QStringList errorList = res.errorStrings();
QString errors;
if( ! errorList.isEmpty() ) {
errors = res.errorStrings().join(QLatin1String("<br/>"));
}
Theme *theme = Theme::instance();
item->setData( theme->statusHeaderText( status ), Qt::ToolTipRole );
if( f->syncEnabled() && f->userSyncEnabled() ) {
if( status == SyncResult::SyncPrepare ) {
if( _wasDisabledBefore ) {
// if the folder was disabled before, set the sync icon
item->setData( theme->syncStateIcon( SyncResult::SyncRunning), FolderStatusDelegate::FolderStatusIconRole );
} // we keep the previous icon for the SyncPrepare state.
} else {
// kepp the previous icon for the prepare phase.
item->setData( theme->syncStateIcon( status ), FolderStatusDelegate::FolderStatusIconRole );
}
if( f->syncEnabled() ) {
item->setData( theme->syncStateIcon( status ), FolderStatusDelegate::FolderStatusIconRole );
} else {
item->setData( theme->folderDisabledIcon( ), FolderStatusDelegate::FolderStatusIconRole ); // size 48 before
_wasDisabledBefore = false;
item->setData( theme->folderDisabledIcon( ), FolderStatusDelegate::FolderStatusIconRole ); // size 48 before
}
item->setData( theme->statusHeaderText( status ), FolderStatusDelegate::FolderStatus );
item->setData( theme->statusHeaderText( status ), FolderStatusDelegate::FolderStatus );
item->setData( errors, FolderStatusDelegate::FolderErrorMsg );
if( errorList.isEmpty() ) {
if( (status == SyncResult::Error ||
status == SyncResult::SetupError ||
status == SyncResult::Unavailable )) {
errorList << theme->statusHeaderText(status);
}
if( errors.isEmpty() && (status == SyncResult::Error ||
status == SyncResult::SetupError ||
status == SyncResult::Unavailable )) {
item->setData( theme->statusHeaderText(status), FolderStatusDelegate::FolderErrorMsg);
}
item->setData( errorList, FolderStatusDelegate::FolderErrorMsg);
bool ongoing = false;
item->setData( QVariant(res.warnCount()), FolderStatusDelegate::WarningCount );
if( status == SyncResult::SyncRunning ) {
@@ -267,8 +257,6 @@ void AccountSettings::slotRemoveCurrentFolder()
{
QModelIndex selected = ui->_folderList->selectionModel()->currentIndex();
if( selected.isValid() ) {
int row = selected.row();
QString alias = _model->data( selected, FolderStatusDelegate::FolderAliasRole ).toString();
qDebug() << "Remove Folder alias " << alias;
if( !alias.isEmpty() ) {
@@ -282,22 +270,9 @@ void AccountSettings::slotRemoveCurrentFolder()
if( ret == QMessageBox::No ) {
return;
}
/* Remove the selected item from the timer hash. */
QStandardItem *item = NULL;
if( selected.isValid() )
item = _model->itemFromIndex(selected);
if( selected.isValid() && item && _hideProgressTimers.contains(item) ) {
QTimer *t = _hideProgressTimers[item];
t->stop();
_hideProgressTimers.remove(item);
delete(t);
}
FolderMan *folderMan = FolderMan::instance();
folderMan->slotRemoveFolder( alias );
_model->removeRow(row);
setFolderList(folderMan->map());
emit folderChanged();
slotCheckConnection();
}
@@ -333,22 +308,6 @@ void AccountSettings::slotDoubleClicked( const QModelIndex& indx )
emit openFolderAlias( alias );
}
void AccountSettings::showConnectionLabel( const QString& message, const QString& tooltip )
{
const QString errStyle = QLatin1String("color:#ffffff; background-color:#bb4d4d;padding:5px;"
"border-width: 1px; border-style: solid; border-color: #aaaaaa;"
"border-radius:5px;");
if( _generalErrors.isEmpty() ) {
ui->connectLabel->setText( message );
ui->connectLabel->setToolTip(tooltip);
} else {
const QString msg = _generalErrors.join(QLatin1String("\n"));
ui->connectLabel->setText( msg );
ui->connectLabel->setToolTip(QString());
ui->connectLabel->setStyleSheet(errStyle);
}
}
void AccountSettings::slotCheckConnection()
{
if( ownCloudInfo::instance()->isConfigured() ) {
@@ -357,12 +316,12 @@ void AccountSettings::slotCheckConnection()
connect(ownCloudInfo::instance(), SIGNAL(noOwncloudFound(QNetworkReply*)),
this, SLOT(slotOCInfoFail(QNetworkReply*)));
showConnectionLabel( tr("Checking %1 connection...").arg(Theme::instance()->appNameGUI()));
ui->connectLabel->setText( tr("Checking %1 connection...").arg(Theme::instance()->appNameGUI()));
qDebug() << "Check status.php from statusdialog.";
ownCloudInfo::instance()->checkInstallation();
} else {
// ownCloud is not yet configured.
showConnectionLabel( tr("No %1 connection configured.").arg(Theme::instance()->appNameGUI()) );
ui->connectLabel->setText( tr("No %1 connection configured.").arg(Theme::instance()->appNameGUI()));
ui->_ButtonAdd->setEnabled( false);
}
}
@@ -370,14 +329,8 @@ void AccountSettings::slotCheckConnection()
void AccountSettings::setFolderList( const Folder::Map &folders )
{
_model->clear();
foreach(QTimer *t, _hideProgressTimers) {
t->stop();
delete t;
}
_hideProgressTimers.clear();
foreach( Folder *f, folders ) {
qDebug() << "Folder: " << f;
slotAddFolder( f );
}
@@ -445,11 +398,7 @@ void AccountSettings::slotEnableCurrentFolder()
if ( f->isBusy() && terminate )
folderMan->terminateSyncProcess( alias );
folderMan->slotGuiPauseFolder( alias, !folderEnabled );
// keep state for the icon setting.
if( !folderEnabled ) _wasDisabledBefore = true;
folderMan->slotEnableFolder( alias, !folderEnabled );
slotUpdateFolderState (f);
// set the button text accordingly.
slotFolderActivated( selected );
@@ -501,8 +450,8 @@ void AccountSettings::slotOCInfo( const QString& url, const QString& versionStr,
ui->connectLabel->setOpenExternalLinks(true);
QUrl safeUrl(url);
safeUrl.setPassword(QString()); // Remove the password from the URL to avoid showing it in the UI
showConnectionLabel( tr("Connected to <a href=\"%1\">%2</a>.").arg(url, safeUrl.toString()),
tr("Version: %1 (%2)").arg(versionStr).arg(version) );
ui->connectLabel->setText( tr("Connected to <a href=\"%1\">%2</a>.").arg(url, safeUrl.toString()) );
ui->connectLabel->setToolTip( tr("Version: %1 (%2)").arg(versionStr).arg(version));
ui->_ButtonAdd->setEnabled(true);
disconnect(ownCloudInfo::instance(), SIGNAL(ownCloudInfoFound(const QString&, const QString&, const QString&, const QString&)),
@@ -516,7 +465,7 @@ void AccountSettings::slotOCInfoFail( QNetworkReply *reply)
QString errStr = tr("unknown problem.");
if( reply ) errStr = reply->errorString();
showConnectionLabel( tr("<p>Failed to connect to %1: <tt>%2</tt></p>").arg(Theme::instance()->appNameGUI()).arg(errStr) );
ui->connectLabel->setText( tr("<p>Failed to connect to %1: <tt>%2</tt></p>").arg(Theme::instance()->appNameGUI()).arg(errStr) );
ui->_ButtonAdd->setEnabled( false);
disconnect(ownCloudInfo::instance(), SIGNAL(ownCloudInfoFound(const QString&, const QString&, const QString&, const QString&)),
@@ -589,7 +538,7 @@ void AccountSettings::slotProgressProblem(const QString& folder, const Progress:
void AccountSettings::slotSetProgress(const QString& folder, const Progress::Info &progress )
{
// qDebug() << "================================> Progress for folder " << folder << " progress " << Progress::asResultString(progress.kind);
// qDebug() << "================================> Progress for folder " << folder << " file " << file << ": "<< p1;
QStandardItem *item = itemForFolder( folder );
qint64 prog1 = progress.current_file_bytes;
qint64 prog2 = progress.file_size;
@@ -603,11 +552,6 @@ void AccountSettings::slotSetProgress(const QString& folder, const Progress::Inf
qDebug() << "================================> INVALID Progress for folder " << folder;
return;
}
if( (progress.kind == Progress::StartSync || progress.kind == Progress::EndSync)
&& progress.overall_file_count == 0 ) {
// do not show progress if nothing is transmitted.
return;
}
QString itemFileName = shortenFilename(folder, progress.current_file);
QString syncFileProgressString;
@@ -710,21 +654,12 @@ void AccountSettings::slotHideProgress()
while (i != _hideProgressTimers.constEnd()) {
if( i.value() == send_timer ) {
QStandardItem *item = i.key();
item->setData( QVariant(false), FolderStatusDelegate::AddProgressSpace );
item->setData( QVariant(QString::null), FolderStatusDelegate::SyncProgressOverallString );
item->setData( QVariant(QString::null), FolderStatusDelegate::SyncProgressItemString );
item->setData( 0, FolderStatusDelegate::SyncProgressOverallPercent );
/* Check if this item is still existing */
bool ok = false;
for( int r = 0; !ok && r < _model->rowCount(); r++) {
if( item == _model->item(r,0) ) {
ok = true;
}
}
if( ok ) {
item->setData( QVariant(false), FolderStatusDelegate::AddProgressSpace );
item->setData( QVariant(QString::null), FolderStatusDelegate::SyncProgressOverallString );
item->setData( QVariant(QString::null), FolderStatusDelegate::SyncProgressItemString );
item->setData( 0, FolderStatusDelegate::SyncProgressOverallPercent );
}
ui->_folderList->repaint();
_hideProgressTimers.remove(item);
break;
}
+3 -5
Ver Arquivo
@@ -51,6 +51,7 @@ public:
void setFolderList( const Folder::Map& );
void buttonsSetEnabled();
void setListWidgetItem(QListWidgetItem* item);
signals:
void folderChanged();
@@ -73,8 +74,6 @@ public slots:
void slotUpdateQuota( qint64,qint64 );
void slotIgnoreFilesEditor();
void setGeneralErrors( const QStringList& errors );
protected slots:
void slotAddFolder();
void slotAddFolder( Folder* );
@@ -91,17 +90,16 @@ private:
QString shortenFilename( const QString& folder, const QString& file ) const;
void folderToModelItem( QStandardItem *, Folder * );
QStandardItem* itemForFolder(const QString& );
void showConnectionLabel( const QString& message, const QString& tooltip = QString() );
Ui::AccountSettings *ui;
QPointer<ItemProgressDialog> _fileItemDialog;
QPointer<IgnoreListEditor> _ignoreEditor;
QStandardItemModel *_model;
QListWidgetItem *_item;
QUrl _OCUrl;
QHash<QStandardItem*, QTimer*> _hideProgressTimers;
QString _kindContext;
QStringList _generalErrors;
bool _wasDisabledBefore;
};
} // namespace Mirall
+38 -70
Ver Arquivo
@@ -23,6 +23,7 @@
#include "mirall/folder.h"
#include "mirall/folderman.h"
#include "mirall/folderwatcher.h"
#include "mirall/folderwizard.h"
#include "mirall/networklocation.h"
#include "mirall/folder.h"
#include "mirall/owncloudsetupwizard.h"
@@ -82,7 +83,7 @@ static const char optionsC[] =
QString applicationTrPath()
{
#ifdef Q_OS_LINUX
return QString::fromLatin1(DATADIR"/"APPLICATION_EXECUTABLE"/i18n/");
return QString::fromLatin1(DATADIR"/i18n/");
#endif
#ifdef Q_OS_MAC
return QApplication::applicationDirPath()+QLatin1String("/../Resources/Translations"); // path defaults to app dir.
@@ -104,7 +105,6 @@ Application::Application(int &argc, char **argv) :
_recentActionsMenu(0),
_theme(Theme::instance()),
_logBrowser(0),
_startupNetworkError(false),
_logExpire(0),
_showLogWindow(false),
_logFlush(false),
@@ -156,17 +156,15 @@ Application::Application(int &argc, char **argv) :
}
#endif
// connect(_networkMgr, SIGNAL(onlineStateChanged(bool)), SLOT(slotCheckConnection()));
MirallConfigFile cfg;
_theme->setSystrayUseMonoIcons(cfg.monoIcons());
connect (_theme, SIGNAL(systrayUseMonoIconsChanged(bool)), SLOT(slotUseMonoIconsChanged(bool)));
setupActions();
setupSystemTray();
slotSetupProxy();
folderMan->setupFolders();
slotSetupProxy(); // folders have to be defined first.
// startup procedure.
QTimer::singleShot( 0, this, SLOT( slotCheckConnection() ));
@@ -181,13 +179,18 @@ Application::Application(int &argc, char **argv) :
connect( ownCloudInfo::instance(), SIGNAL(quotaUpdated(qint64,qint64)),
SLOT(slotRefreshQuotaDisplay(qint64, qint64)));
connect (this, SIGNAL(aboutToQuit()), SLOT(slotCleanup()));
qDebug() << "Network Location: " << NetworkLocation::currentLocation().encoded();
}
Application::~Application()
{
if (_settingsDialog) {
delete _settingsDialog.data();
}
delete _logBrowser;
delete _tray; // needed, see ctor
qDebug() << "* Mirall shutdown";
}
@@ -226,24 +229,8 @@ void Application::slotCredentialsFetched()
runValidator();
}
void Application::slotCleanup()
{
// explicitly close windows. This is somewhat of a hack to ensure
// that saving the geometries happens ASAP during a OS shutdown
// those do delete on close
if (!_settingsDialog.isNull()) _settingsDialog->close();
if (!_progressDialog.isNull()) _progressDialog->close();
// those need an extra invitation
if (!_tray.isNull()) _tray->deleteLater();
if (!_logBrowser.isNull()) _logBrowser->deleteLater();
}
void Application::runValidator()
{
_startupFail.clear();
_conValidator = new ConnectionValidator();
connect( _conValidator, SIGNAL(connectionResult(ConnectionValidator::Status)),
this, SLOT(slotConnectionValidatorResult(ConnectionValidator::Status)) );
@@ -258,25 +245,24 @@ void Application::slotConnectionValidatorResult(ConnectionValidator::Status stat
FolderMan *folderMan = FolderMan::instance();
qDebug() << "######## Connection and Credentials are ok!";
folderMan->setSyncEnabled(true);
_tray->setIcon( _theme->syncStateIcon( SyncResult::NotYetStarted, true ) );
_tray->show();
int cnt = folderMan->map().size();
slotShowOptionalTrayMessage(tr("%1 Sync Started").arg(_theme->appNameGUI()),
slotShowTrayMessage(tr("%1 Sync Started").arg(_theme->appNameGUI()),
tr("Sync started for %n configured sync folder(s).","", cnt));
// queue up the sync for all folders.
folderMan->slotScheduleAllFolders();
computeOverallSyncStatus();
setupContextMenu();
} else if( status == ConnectionValidator::NotConfigured ) {
// this can not happen, it should be caught in first step of startup.
} else {
// if we have problems here, it's unlikely that syncing will work.
FolderMan::instance()->setSyncEnabled(false);
_startupFail = _conValidator->errors();
_startupNetworkError = _conValidator->networkError();
QTimer::singleShot(30*1000, this, SLOT(slotCheckConnection()));
// What else?
}
computeOverallSyncStatus();
setupContextMenu();
_conValidator->deleteLater();
}
@@ -361,7 +347,7 @@ void Application::setupSystemTray()
_tray = new Systray();
_tray->setIcon( _theme->syncStateIcon( SyncResult::NotYetStarted, true ) );
connect(_tray.data(), SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
connect(_tray,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
SLOT(slotTrayClicked(QSystemTrayIcon::ActivationReason)));
setupContextMenu();
@@ -439,7 +425,7 @@ void Application::setupContextMenu()
void Application::setupLogBrowser()
{
// might be called from second instance
if (_logBrowser.isNull()) {
if (!_logBrowser) {
// init the log browser.
qInstallMsgHandler( mirallLogCatcher );
_logBrowser = new LogBrowser;
@@ -517,7 +503,6 @@ void Application::slotSetupProxy()
switch(proxyType) {
case QNetworkProxy::NoProxy:
QNetworkProxyFactory::setUseSystemConfiguration(false);
QNetworkProxy::setApplicationProxy(QNetworkProxy::NoProxy);
break;
case QNetworkProxy::DefaultProxy:
@@ -525,12 +510,10 @@ void Application::slotSetupProxy()
break;
case QNetworkProxy::Socks5Proxy:
proxy.setType(QNetworkProxy::Socks5Proxy);
QNetworkProxyFactory::setUseSystemConfiguration(false);
QNetworkProxy::setApplicationProxy(proxy);
break;
case QNetworkProxy::HttpProxy:
proxy.setType(QNetworkProxy::HttpProxy);
QNetworkProxyFactory::setUseSystemConfiguration(false);
QNetworkProxy::setApplicationProxy(proxy);
break;
default:
@@ -679,7 +662,7 @@ bool Application::checkConfigExists(bool openSettings)
// if no config file is there, start the configuration wizard.
MirallConfigFile cfgFile;
if( cfgFile.exists() && !cfgFile.ownCloudUrl().isEmpty() ) {
if( cfgFile.exists() ) {
if( openSettings ) {
slotSettings();
}
@@ -711,9 +694,7 @@ void Application::slotSettings()
_settingsDialog->setAttribute( Qt::WA_DeleteOnClose, true );
_settingsDialog->show();
}
_settingsDialog->setGeneralErrors( _startupFail );
Utility::raiseDialog(_settingsDialog.data());
Utility::raiseDialog(_settingsDialog);
}
void Application::slotItemProgressDialog()
@@ -724,7 +705,7 @@ void Application::slotItemProgressDialog()
_progressDialog->setupList();
_progressDialog->show();
}
Utility::raiseDialog(_progressDialog.data());
Utility::raiseDialog(_progressDialog);
}
void Application::slotParseOptions(const QString &opts)
@@ -835,36 +816,23 @@ void Application::computeOverallSyncStatus()
Folder::Map map = folderMan->map();
SyncResult overallResult = FolderMan::accountStatus(map.values());
// if there have been startup problems, show an error message.
if( !_startupFail.isEmpty() ) {
trayMessage = _startupFail.join(QLatin1String("\n"));
QIcon statusIcon;
if (_startupNetworkError) {
statusIcon = _theme->syncStateIcon( SyncResult::NotYetStarted, true );
} else {
statusIcon = _theme->syncStateIcon( SyncResult::Error, true );
// create the tray blob message, check if we have an defined state
if( overallResult.status() != SyncResult::Undefined ) {
QStringList allStatusStrings;
foreach(Folder* folder, map.values()) {
qDebug() << "Folder in overallStatus Message: " << folder << " with name " << folder->alias();
QString folderMessage = folderMan->statusToString(folder->syncResult().status(), folder->syncEnabled());
allStatusStrings += tr("Folder %1: %2").arg(folder->alias(), folderMessage);
}
if( ! allStatusStrings.isEmpty() )
trayMessage = allStatusStrings.join(QLatin1String("\n"));
else
trayMessage = tr("No sync folders configured.");
QIcon statusIcon = _theme->syncStateIcon( overallResult.status(), true);
_tray->setIcon( statusIcon );
_tray->setToolTip(trayMessage);
} else {
// create the tray blob message, check if we have an defined state
if( overallResult.status() != SyncResult::Undefined ) {
QStringList allStatusStrings;
foreach(Folder* folder, map.values()) {
qDebug() << "Folder in overallStatus Message: " << folder << " with name " << folder->alias();
QString folderMessage = folderMan->statusToString(folder->syncResult().status(), folder->syncEnabled());
allStatusStrings += tr("Folder %1: %2").arg(folder->alias(), folderMessage);
}
if( ! allStatusStrings.isEmpty() )
trayMessage = allStatusStrings.join(QLatin1String("\n"));
else
trayMessage = tr("No sync folders configured.");
QIcon statusIcon = _theme->syncStateIcon( overallResult.status(), true);
_tray->setIcon( statusIcon );
_tray->setToolTip(trayMessage);
}
}
}
+4 -5
Ver Arquivo
@@ -40,6 +40,7 @@ namespace Mirall {
class Theme;
class Folder;
class FolderWatcher;
class FolderWizard;
class ownCloudInfo;
class SslErrorDialog;
class SettingsDialog;
@@ -106,14 +107,13 @@ protected slots:
void slotDisplayIdle();
void slotHelp();
void slotCredentialsFetched();
void slotCleanup();
private:
void setHelp();
void raiseDialog( QWidget* );
void rebuildRecentMenus();
void runValidator();
QPointer<Systray> _tray;
Systray *_tray;
QAction *_actionOpenoC;
QAction *_actionSettings;
QAction *_actionQuota;
@@ -124,6 +124,7 @@ private:
QNetworkConfigurationManager *_networkMgr;
QPointer<FolderWizard> _folderWizard;
SslErrorDialog *_sslErrorDialog;
ConnectionValidator *_conValidator;
@@ -133,14 +134,12 @@ private:
Theme *_theme;
QSignalMapper *_folderOpenActionMapper;
QPointer<LogBrowser>_logBrowser;
LogBrowser *_logBrowser;
QPointer<SettingsDialog> _settingsDialog;
QPointer<ItemProgressDialog> _progressDialog;
QString _logFile;
QString _logDirectory;
QStringList _startupFail;
bool _startupNetworkError;
int _logExpire;
bool _showLogWindow;
+5 -15
Ver Arquivo
@@ -28,8 +28,7 @@ ConnectionValidator::ConnectionValidator(QObject *parent) :
ConnectionValidator::ConnectionValidator(const QString& connection, QObject *parent)
: QObject(parent),
_connection(connection),
_networkError(QNetworkReply::NoError)
_connection(connection)
{
ownCloudInfo::instance()->setCustomConfigHandle(_connection);
}
@@ -39,11 +38,6 @@ QStringList ConnectionValidator::errors() const
return _errors;
}
bool ConnectionValidator::networkError() const
{
return _networkError;
}
QString ConnectionValidator::statusString( Status stat ) const
{
QString re;
@@ -95,7 +89,6 @@ void ConnectionValidator::checkConnection()
// checks for status.php
ownCloudInfo::instance()->checkInstallation();
} else {
_errors << tr("No ownCloud connection configured");
emit connectionResult( NotConfigured );
}
}
@@ -116,8 +109,8 @@ void ConnectionValidator::slotStatusFound( const QString& url, const QString& ve
this, SLOT(slotNoStatusFound(QNetworkReply*)));
if( version.startsWith("4.0") ) {
_errors.append( tr("The configured server for this client is too old") );
_errors.append( tr("Please update to the latest server and restart the client.") );
_errors.append( tr("<p>The configured server for this client is too old.</p>"
"<p>Please update to the latest server and restart the client.</p>"));
emit connectionResult( ServerVersionMismatch );
return;
}
@@ -136,7 +129,6 @@ void ConnectionValidator::slotNoStatusFound(QNetworkReply *reply)
this, SLOT(slotNoStatusFound(QNetworkReply*)));
_errors.append( reply->errorString() );
_networkError = (reply->error() != QNetworkReply::NoError);
emit connectionResult( StatusNotFound );
}
@@ -152,17 +144,15 @@ void ConnectionValidator::slotCheckAuthentication()
// continue in slotAuthCheck here :-)
}
void ConnectionValidator::slotAuthCheck( const QString&, QNetworkReply *reply )
void ConnectionValidator::slotAuthCheck( const QString& ,QNetworkReply *reply )
{
Status stat = Connected;
if( reply->error() == QNetworkReply::AuthenticationRequiredError ||
reply->error() == QNetworkReply::OperationCanceledError ) { // returned if the user is wrong.
qDebug() << "******** Password is wrong!";
_errors << tr("The provided credentials are not correct");
_errors << "The provided credentials are wrong.";
stat = CredentialsWrong;
} else if( reply->error() != QNetworkReply::NoError ) {
_errors << reply->errorString();
}
// disconnect from ownCloud Info signals
-2
Ver Arquivo
@@ -42,7 +42,6 @@ public:
};
QStringList errors() const;
bool networkError() const;
void checkConnection();
@@ -65,7 +64,6 @@ protected slots:
private:
QStringList _errors;
QString _connection;
bool _networkError;
};
}
+1 -1
Ver Arquivo
@@ -159,7 +159,7 @@ QString CSyncThread::csyncErrorToString( CSYNC_ERROR_CODE err, const char *errSt
}
if( errString ) {
errStr += tr(" Backend Message: ")+QString::fromUtf8(errString);
errStr += tr("<br/>Backend Message: ")+QString::fromUtf8(errString);
}
return errStr;
+25 -65
Ver Arquivo
@@ -50,13 +50,10 @@ Folder::Folder(const QString &alias, const QString &path, const QString& secondP
, _secondPath(secondPath)
, _alias(alias)
, _enabled(true)
, _userSyncEnabled(true)
, _thread(0)
, _csync(0)
, _csyncError(false)
, _csyncUnavail(false)
, _wipeDb(false)
, _proxyDirty(true)
, _csync_ctx(0)
{
qsrand(QTime::currentTime().msec());
@@ -114,7 +111,6 @@ bool Folder::init()
}
return _csync_ctx;
}
Folder::~Folder()
{
if( _thread ) {
@@ -200,33 +196,19 @@ bool Folder::syncEnabled() const
void Folder::setSyncEnabled( bool doit )
{
_enabled = doit;
_watcher->setEventsEnabled( doit );
if( doit && userSyncEnabled() ) {
// qDebug() << "Syncing enabled on folder " << name();
_pollTimer.start();
_watcher->clearPendingEvents(); // FIXME 1.5: Why isn't that happening in setEventsEnabled?
_watcher->setEventsEnabled(true);
_timeSinceLastSync.restart();
qDebug() << "setSyncEnabled - ############################ " << doit;
if( doit ) {
// undefined until next sync
_syncResult.setStatus( SyncResult::NotYetStarted);
_syncResult.clearErrors();
evaluateSync( QStringList() );
} else {
// do not stop or start the watcher here, that is done internally by
// folder class. Even if the watcher fires, the folder does not
// schedule itself because it checks the var. _enabled before.
_pollTimer.stop();
_watcher->setEventsEnabled(false);
}
}
bool Folder::userSyncEnabled()
{
return _userSyncEnabled;
}
void Folder::slotSetSyncUserEnabled( bool enable )
{
_userSyncEnabled = enable;
setSyncEnabled( syncEnabled() ); // no change on the system enable flag.
}
void Folder::setSyncState(SyncResult::Status state)
{
_syncResult.setStatus(state);
@@ -239,17 +221,12 @@ SyncResult Folder::syncResult() const
void Folder::evaluateSync(const QStringList &/*pathList*/)
{
if( !syncEnabled() ) {
if( !_enabled ) {
qDebug() << "*" << alias() << "sync skipped, disabled!";
return;
}
if( !userSyncEnabled() ) {
qDebug() << "*" << alias() << "sync skipped, user disabled!";
return;
}
_syncResult.setStatus( SyncResult::NotYetStarted );
_syncResult.clearErrors();
emit scheduleToSync( alias() );
}
@@ -258,10 +235,8 @@ void Folder::slotPollTimerTimeout()
{
qDebug() << "* Polling" << alias() << "for changes. (time since next sync:" << (_timeSinceLastSync.elapsed() / 1000) << "s)";
// Force sync if the last sync is a long time ago or if there was a serious problem.
if (quint64(_timeSinceLastSync.elapsed()) > MirallConfigFile().forceSyncInterval() ||
!(_syncResult.status() == SyncResult::Success || _syncResult.status() == SyncResult::Problem)) {
qDebug() << "** Force Sync now";
if (quint64(_timeSinceLastSync.elapsed()) > MirallConfigFile().forceSyncInterval()) {
qDebug() << "* Force Sync now";
evaluateSync(QStringList());
} else {
RequestEtagJob* job = new RequestEtagJob(secondPath(), this);
@@ -313,7 +288,7 @@ void Folder::bubbleUpSyncResult()
foreach (const SyncFileItem &item, _syncResult.syncFileItemVector() ) {
if( item._instruction == CSYNC_INSTRUCTION_ERROR ) {
slotCSyncError( tr("File %1: %2").arg(item._file).arg(item._errorString) );
logger->postOptionalGuiLog(tr("File %1").arg(item._file), item._errorString);
logger->postGuiLog(tr("File %1").arg(item._file), item._errorString);
} else {
if (item._dir == SyncFileItem::Down) {
@@ -364,25 +339,25 @@ void Folder::bubbleUpSyncResult()
if (newItems > 0) {
QString file = QDir::toNativeSeparators(firstItemNew._file);
if (newItems == 1)
logger->postOptionalGuiLog(tr("New file available"), tr("'%1' has been synced to this machine.").arg(file));
logger->postGuiLog(tr("New file available"), tr("'%1' has been synced to this machine.").arg(file));
else
logger->postOptionalGuiLog(tr("New files available"), tr("'%1' and %n other file(s) have been synced to this machine.",
logger->postGuiLog(tr("New files available"), tr("'%1' and %n other file(s) have been synced to this machine.",
"", newItems-1).arg(file));
}
if (removedItems > 0) {
QString file = QDir::toNativeSeparators(firstItemDeleted._file);
if (removedItems == 1)
logger->postOptionalGuiLog(tr("File removed"), tr("'%1' has been removed.").arg(file));
logger->postGuiLog(tr("File removed"), tr("'%1' has been removed.").arg(file));
else
logger->postOptionalGuiLog(tr("Files removed"), tr("'%1' and %n other file(s) have been removed.",
logger->postGuiLog(tr("Files removed"), tr("'%1' and %n other file(s) have been removed.",
"", removedItems-1).arg(file));
}
if (updatedItems > 0) {
QString file = QDir::toNativeSeparators(firstItemUpdated._file);
if (updatedItems == 1)
logger->postOptionalGuiLog(tr("File updated"), tr("'%1' has been updated.").arg(file));
logger->postGuiLog(tr("File updated"), tr("'%1' has been updated.").arg(file));
else
logger->postOptionalGuiLog(tr("Files updated"), tr("'%1' and %n other file(s) have been updated.",
logger->postGuiLog(tr("Files updated"), tr("'%1' and %n other file(s) have been updated.",
"", updatedItems-1).arg(file));
}
}
@@ -424,7 +399,7 @@ void Folder::slotThreadTreeWalkResult(const SyncFileItemVector& items)
void Folder::slotCatchWatcherError(const QString& error)
{
Logger::instance()->postOptionalGuiLog(tr("Error"), error);
Logger::instance()->postGuiLog(tr("Error"), error);
}
void Folder::slotTerminateSync()
@@ -457,7 +432,6 @@ void Folder::slotTerminateSync()
_csyncError = true;
qDebug() << "-> CSync Terminated!";
slotCSyncFinished();
setSyncEnabled(false);
}
// This removes the csync File database if the sync folder definition is removed
@@ -525,21 +499,10 @@ void Folder::setProxy()
csync_set_module_property(_csync_ctx, "proxy_user", proxy.user().toUtf8().data() );
csync_set_module_property(_csync_ctx, "proxy_pwd" , proxy.password().toUtf8().data() );
setProxyDirty(false);
} else {
qDebug() << "WRN: Unable to set Proxy without csync-ctx!";
FolderMan::instance()->setDirtyProxy(false);
}
}
void Folder::setProxyDirty(bool value)
{
_proxyDirty = value;
}
bool Folder::proxyDirty()
{
return _proxyDirty;
}
const char* Folder::proxyTypeToCStr(QNetworkProxy::ProxyType type)
{
@@ -575,7 +538,7 @@ void Folder::startSync(const QStringList &pathList)
QMetaObject::invokeMethod(this, "slotCSyncFinished", Qt::QueuedConnection);
return;
}
} else if (proxyDirty()) {
} else if (FolderMan::instance()->isDirtyProxy()) {
setProxy();
}
@@ -598,6 +561,7 @@ void Folder::startSync(const QStringList &pathList)
qDebug() << "*** Start syncing";
_thread = new QThread(this);
_thread->setPriority(QThread::LowPriority);
setIgnoredFiles();
_csync = new CSyncThread( _csync_ctx );
_csync->moveToThread(_thread);
@@ -620,7 +584,6 @@ void Folder::startSync(const QStringList &pathList)
connect(_csync, SIGNAL(transmissionProgress(Progress::Info)), this, SLOT(slotTransmissionProgress(Progress::Info)));
_thread->start();
_thread->setPriority(QThread::LowPriority);
QMetaObject::invokeMethod(_csync, "startSync", Qt::QueuedConnection);
// disable events until syncing is done
@@ -649,13 +612,10 @@ void Folder::slotCsyncUnavailable()
void Folder::slotCSyncFinished()
{
qDebug() << "-> CSync Finished slot for" << alias() << "with error" << _csyncError;
if( syncEnabled() && userSyncEnabled() ) {
qDebug() << "Sync is enabled - starting the polltimer again.";
_watcher->setEventsEnabledDelayed(2000);
_pollTimer.start();
_timeSinceLastSync.restart();
}
qDebug() << "-> CSync Finished slot with error " << _csyncError;
_watcher->setEventsEnabledDelayed(2000);
_pollTimer.start();
_timeSinceLastSync.restart();
bubbleUpSyncResult();
-12
Ver Arquivo
@@ -150,16 +150,6 @@ public slots:
*/
void startSync(const QStringList &pathList = QStringList());
void setProxyDirty(bool value);
bool proxyDirty();
/**
* @brief slotSetSyncUserEnabled - slot that sets the enable/disable flag from the GUI
* @param enable
*/
void slotSetSyncUserEnabled( bool enable );
bool userSyncEnabled();
private slots:
void slotCSyncStarted();
void slotCSyncError(const QString& );
@@ -204,7 +194,6 @@ protected:
QString _configFile;
QFileSystemWatcher *_pathWatcher;
bool _enabled;
bool _userSyncEnabled; // enabled by user interaction?
FolderWatcher *_watcher;
SyncResult _syncResult;
QThread *_thread;
@@ -213,7 +202,6 @@ protected:
bool _csyncError;
bool _csyncUnavail;
bool _wipeDb;
bool _proxyDirty;
Progress::Kind _progressKind;
QTimer _pollTimer;
QString _lastEtag;
+11 -24
Ver Arquivo
@@ -37,7 +37,8 @@ FolderMan* FolderMan::_instance = 0;
FolderMan::FolderMan(QObject *parent) :
QObject(parent),
_syncEnabled( true )
_syncEnabled( true ),
_dirtyProxy( true )
{
// if QDir::mkpath would not be so stupid, I would not need to have this
// duplication of folderConfigPath() here
@@ -269,7 +270,7 @@ Folder* FolderMan::setupFolderFromConfigFile(const QString &file) {
return folder;
}
void FolderMan::slotGuiPauseFolder( const QString& alias, bool enable )
void FolderMan::slotEnableFolder( const QString& alias, bool enable )
{
if( ! _folderMap.contains( alias ) ) {
qDebug() << "!! Can not enable alias " << alias << ", can not be found in folderMap.";
@@ -278,8 +279,7 @@ void FolderMan::slotGuiPauseFolder( const QString& alias, bool enable )
Folder *f = _folderMap[alias];
if( f ) {
f->slotSetSyncUserEnabled(enable);
f->evaluateSync(QStringList());
f->setSyncEnabled(enable);
}
}
@@ -361,10 +361,6 @@ void FolderMan::setSyncEnabled( bool enabled )
QTimer::singleShot(200, this, SLOT(slotScheduleFolderSync()));
}
_syncEnabled = enabled;
foreach( Folder *f, _folderMap.values() ) {
f->setSyncEnabled(enabled);
}
}
/*
@@ -390,8 +386,8 @@ void FolderMan::slotScheduleFolderSync()
if( _folderMap.contains( alias ) ) {
ownCloudInfo::instance()->getQuotaRequest("/");
Folder *f = _folderMap[alias];
if( f->syncEnabled() ) {
_currentSyncFolder = alias;
_currentSyncFolder = alias;
if (f->syncEnabled()) {
f->startSync( QStringList() );
}
}
@@ -471,10 +467,7 @@ void FolderMan::removeFolder( const QString& alias )
qDebug() << "Remove folder config file " << file.fileName();
file.remove();
}
// FIXME: this is a temporar dirty fix against a crash happening because
// the csync owncloud module still has static components. Activate the
// delete once the module is fixed.
// f->deleteLater();
f->deleteLater();
}
}
@@ -520,14 +513,6 @@ bool FolderMan::startFromScratch( const QString& localFolder )
return false;
}
void FolderMan::setDirtyProxy(bool value)
{
foreach( Folder *f, _folderMap.values() ) {
f->setProxyDirty(value);
}
}
SyncResult FolderMan::accountStatus(const QList<Folder*> &folders)
{
SyncResult overallResult(SyncResult::Undefined);
@@ -553,7 +538,6 @@ SyncResult FolderMan::accountStatus(const QList<Folder*> &folders)
case SyncResult::Unavailable:
overallResult.setStatus( SyncResult::Unavailable );
break;
case SyncResult::Problem:
case SyncResult::Success:
if( overallResult.status() == SyncResult::Undefined )
overallResult.setStatus( SyncResult::Success );
@@ -565,7 +549,10 @@ SyncResult FolderMan::accountStatus(const QList<Folder*> &folders)
if ( overallResult.status() != SyncResult::Error )
overallResult.setStatus( SyncResult::SetupError );
break;
case SyncResult::Problem:
if ( overallResult.status() != SyncResult::Problem )
overallResult.setStatus( SyncResult::Problem );
break;
// no default case on purpose, check compiler warnings
}
}
+3 -2
Ver Arquivo
@@ -91,7 +91,7 @@ signals:
public slots:
void slotRemoveFolder( const QString& );
void slotGuiPauseFolder( const QString&, bool );
void slotEnableFolder( const QString&, bool );
void slotFolderSyncStarted();
void slotFolderSyncFinished( const SyncResult& );
@@ -109,7 +109,8 @@ public slots:
void slotScheduleAllFolders();
void setDirtyProxy(bool value = true);
bool isDirtyProxy() { return _dirtyProxy; }
void setDirtyProxy(bool value = true) { _dirtyProxy = value; }
private slots:
// slot to add a folder to the syncing queue
+16 -17
Ver Arquivo
@@ -81,9 +81,8 @@ QSize FolderStatusDelegate::sizeHint(const QStyleOptionViewItem & option ,
h += aliasMargin; // bottom margin
// add some space to show an error condition.
if( ! qvariant_cast<QStringList>(index.data(FolderErrorMsg)).isEmpty() ) {
QStringList errMsgs = qvariant_cast<QStringList>(index.data(FolderErrorMsg));
h += aliasMargin*2 + errMsgs.count()*fm.height();
if( ! qvariant_cast<QString>(index.data(FolderErrorMsg)).isEmpty() ) {
h += aliasMargin*2+fm.height();
}
if( qvariant_cast<bool>(index.data(AddProgressSpace)) ) {
@@ -123,7 +122,7 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
QString aliasText = qvariant_cast<QString>(index.data(FolderAliasRole));
QString pathText = qvariant_cast<QString>(index.data(FolderPathRole));
QString remotePath = qvariant_cast<QString>(index.data(FolderSecondPathRole));
QStringList errorTexts= qvariant_cast<QStringList>(index.data(FolderErrorMsg));
QString errorText = qvariant_cast<QString>(index.data(FolderErrorMsg));
int overallPercent = qvariant_cast<int>(index.data(SyncProgressOverallPercent));
QString overallString = qvariant_cast<QString>(index.data(SyncProgressOverallString));
@@ -212,12 +211,12 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
// paint an error overlay if there is an error string
int h = iconRect.bottom();
if( !errorTexts.isEmpty() ) {
if( !errorText.isEmpty() ) {
h += aliasMargin;
QRect errorRect = localPathRect;
errorRect.setLeft( iconRect.left());
errorRect.setTop( h );
errorRect.setHeight(errorTexts.count() * subFm.height()+aliasMargin);
errorRect.setHeight(subFm.height()+aliasMargin);
errorRect.setRight( option.rect.right()-aliasMargin );
painter->setBrush( QColor(0xbb, 0x4d, 0x4d) );
@@ -227,16 +226,15 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
painter->setPen( Qt::white );
painter->setFont(errorFont);
QRect errorTextRect = errorRect;
errorTextRect.setLeft( errorTextRect.left()+aliasMargin );
errorTextRect.setLeft( errorTextRect.left()+aliasMargin +16);
errorTextRect.setTop( errorTextRect.top()+aliasMargin/2 );
int x = errorTextRect.left();
int y = errorTextRect.top()+aliasMargin/2 + subFm.height()/2;
foreach( QString eText, errorTexts ) {
painter->drawText(x, y, subFm.elidedText( eText, Qt::ElideLeft, errorTextRect.width()-2*aliasMargin));
y += subFm.height();
int linebreak = errorText.indexOf(QLatin1String("<br"));
QString eText = errorText;
if(linebreak) {
eText = errorText.left(linebreak);
}
painter->drawText(errorTextRect, eText);
h = errorRect.bottom();
}
@@ -251,8 +249,8 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
painter->save();
// Sizes-Text
QRect octetRect = progressFm.boundingRect( overallString );
int progressTextWidth = octetRect.width() + 2;
QRect octetRect = subFm.boundingRect( overallString );
int progressTextWidth = octetRect.width();
// Overall Progress Bar.
QRect pBRect;
@@ -281,7 +279,8 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
overallProgressRect.setWidth( progressTextWidth );
painter->setFont(progressFont);
painter->drawText( overallProgressRect, Qt::AlignRight+Qt::AlignVCenter, overallString);
QString elidedText = progressFm.elidedText(overallString, Qt::ElideLeft, overallProgressRect.width());
painter->drawText( overallProgressRect, Qt::AlignRight+Qt::AlignVCenter, elidedText);
// painter->drawRect(overallProgressRect);
// Individual File Progress
@@ -290,7 +289,7 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
fileRect.setLeft( iconRect.left());
fileRect.setWidth(overallWidth);
fileRect.setHeight(fileNameTextHeight);
QString elidedText = progressFm.elidedText(itemString, Qt::ElideLeft, fileRect.width());
elidedText = progressFm.elidedText(itemString, Qt::ElideLeft, fileRect.width());
painter->drawText( fileRect, Qt::AlignLeft+Qt::AlignVCenter, elidedText);
+1 -1
Ver Arquivo
@@ -79,7 +79,7 @@ void FolderWatcher::addIgnoreListFile( const QString& file )
while (!infile.atEnd()) {
QString line = QString::fromLocal8Bit( infile.readLine() ).trimmed();
if( !(line.startsWith( QLatin1Char('#') ) || line.isEmpty()) ) {
if( !line.startsWith( QLatin1Char('#') ) && line.isEmpty() ) {
_ignores.append(line);
}
}
+1 -10
Ver Arquivo
@@ -132,16 +132,7 @@ void FolderWatcherPrivate::slotINotifyEvent(int mask, int /*cookie*/, const QStr
//qDebug() << cookie << " OTHER " << mask << " :" << path;
}
QStringList ignores = _parent->ignores();
if( path.endsWith(".csync_journal.db.ctmp") ||
path.endsWith(".csync_journal.db.ctmp-journal") ||
path.endsWith(".csync_journal.db")) {
qDebug() << " ** Inotify ignored for " <<path;
return;
}
foreach (const QString& pattern, ignores) {
foreach (const QString& pattern, _parent->ignores()) {
QRegExp regexp(pattern);
regexp.setPatternSyntax(QRegExp::Wildcard);
+7 -24
Ver Arquivo
@@ -13,7 +13,6 @@
*/
#include "mirall/folderwizard.h"
#include "mirall/folderman.h"
#include "mirall/owncloudinfo.h"
#include "mirall/mirallconfigfile.h"
#include "mirall/theme.h"
@@ -243,7 +242,6 @@ static void recursiveInsert(QTreeWidgetItem *parent, QStringList pathTrail, QStr
item = new QTreeWidgetItem(parent);
item->setIcon(0, folderIcon);
item->setText(0, pathTrail.first());
item->setData(0, Qt::UserRole, pathTrail.first());
item->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
}
@@ -254,13 +252,17 @@ static void recursiveInsert(QTreeWidgetItem *parent, QStringList pathTrail, QStr
void FolderWizardTargetPage::slotUpdateDirectories(QStringList list)
{
QFileIconProvider prov;
QIcon folderIcon = prov.icon(QFileIconProvider::Folder);
QString webdavFolder = QUrl(ownCloudInfo::instance()->webdavUrl()).path();
connect(_ui.folderTreeWidget, SIGNAL(itemExpanded(QTreeWidgetItem*)), SLOT(slotItemExpanded(QTreeWidgetItem*)));
QTreeWidgetItem *root = _ui.folderTreeWidget->topLevelItem(0);
if (!root) {
root = new QTreeWidgetItem(_ui.folderTreeWidget);
root->setText(0, Theme::instance()->appNameGUI());
root->setIcon(0, Theme::instance()->applicationIcon());
root->setText(0, tr("Root (\"/\")", "root folder"));
root->setIcon(0, folderIcon);
root->setToolTip(0, tr("Choose this to sync the entire account"));
root->setData(0, Qt::UserRole, "/");
}
@@ -281,7 +283,7 @@ void FolderWizardTargetPage::slotRefreshFolders()
void FolderWizardTargetPage::slotItemExpanded(QTreeWidgetItem *item)
{
ownCloudInfo::instance()->getDirectoryListing(item->data(0, Qt::UserRole).toString());
ownCloudInfo::instance()->getDirectoryListing(item->text(0));
}
FolderWizardTargetPage::~FolderWizardTargetPage()
@@ -296,22 +298,6 @@ bool FolderWizardTargetPage::isComplete() const
QString dir = _ui.folderTreeWidget->currentItem()->data(0, Qt::UserRole).toString();
wizard()->setProperty("targetPath", dir);
Folder::Map map = _folderMap;
Folder::Map::const_iterator i = map.constBegin();
for(i = map.constBegin();i != map.constEnd(); i++ ) {
Folder *f = static_cast<Folder*>(i.value());
QString curDir = f->secondPath();
if (dir == curDir) {
showWarn( tr("This directory is already being synced.") );
return false;
} else if (dir.startsWith(curDir)) {
if (dir.isEmpty()) dir = QLatin1Char('/');
if (curDir.isEmpty()) curDir = QLatin1Char('/');
showWarn( tr("You are already syncing <i>%1</i>, which is a parent folder of <i>%2</i>.").arg(curDir).arg(dir) );
return false;
}
}
if( dir == QLatin1String("/") ) {
showWarn( tr("If you sync the root folder, you can <b>not</b> configure another sync directory."));
return true;
@@ -339,8 +325,6 @@ void FolderWizardTargetPage::initializePage()
SLOT(slotCreateRemoteFolderFinished( QNetworkReply::NetworkError )));
connect( ocInfo, SIGNAL(directoryListingUpdated(QStringList)),
SLOT(slotUpdateDirectories(QStringList)));
connect(_ui.folderTreeWidget, SIGNAL(itemExpanded(QTreeWidgetItem*)),
SLOT(slotItemExpanded(QTreeWidgetItem*)));
slotRefreshFolders();
}
@@ -386,7 +370,6 @@ FolderWizard::~FolderWizard()
void FolderWizard::setFolderMap( const Folder::Map& fm)
{
_folderWizardSourcePage->setFolderMap( fm );
_folderWizardTargetPage->setFolderMap( fm );
}
} // end namespace
-3
Ver Arquivo
@@ -69,8 +69,6 @@ public:
virtual void initializePage();
virtual void cleanupPage();
void setFolderMap( const Folder::Map &fm ) { _folderMap = fm; }
protected slots:
void showWarn( const QString& = QString() ) const;
@@ -85,7 +83,6 @@ private:
ownCloudInfo *_ownCloudDirCheck;
bool _dirChecked;
bool _warnWasVisible;
Folder::Map _folderMap;
};
/**
-1
Ver Arquivo
@@ -88,7 +88,6 @@ void INotify::slotActivated(int /*fd*/)
// with the help of watch descriptor, retrieve, corresponding INotify
if (event == NULL) {
qDebug() << "NULL event";
i += sizeof(struct inotify_event);
continue;
}
+3 -7
Ver Arquivo
@@ -39,7 +39,6 @@ ItemProgressDialog::ItemProgressDialog(Application*, QWidget *parent) :
connect(ProgressDispatcher::instance(), SIGNAL(progressSyncProblem(const QString&,const Progress::SyncProblem&)),
this, SLOT(slotProgressErrors(const QString&, const Progress::SyncProblem&)));
// Adjust copyToClipboard() when making changes here!
QStringList header;
header << tr("Time");
header << tr("File");
@@ -211,16 +210,13 @@ void ItemProgressDialog::copyToClipboard()
int topLevelItems = _ui->_treeWidget->topLevelItemCount();
for (int i = 0; i < topLevelItems; i++) {
QTreeWidgetItem *child = _ui->_treeWidget->topLevelItem(i);
ts << left
// time stamp
<< qSetFieldWidth(10)
// time stamp
ts << left << qSetFieldWidth(10)
<< child->data(0,Qt::DisplayRole).toString()
// file name
<< qSetFieldWidth(64)
<< child->data(1,Qt::DisplayRole).toString()
// folder
<< qSetFieldWidth(15)
<< child->data(2, Qt::DisplayRole).toString()
<< qSetFieldWidth(0) << ' '
// action
<< qSetFieldWidth(15)
<< child->data(3, Qt::DisplayRole).toString()
-5
Ver Arquivo
@@ -127,16 +127,11 @@ LogBrowser::LogBrowser(QWidget *parent) :
}
LogBrowser::~LogBrowser()
{
}
void LogBrowser::closeEvent(QCloseEvent *)
{
MirallConfigFile cfg;
cfg.saveGeometry(this);
}
void LogBrowser::slotNewLog( const QString& msg )
{
if( _logWidget->isVisible() ) {
-3
Ver Arquivo
@@ -47,9 +47,6 @@ public:
void setLogFile(const QString& , bool );
protected:
void closeEvent(QCloseEvent *);
protected slots:
void slotNewLog( const QString &msg );
void slotFind();
+3 -7
Ver Arquivo
@@ -138,8 +138,7 @@ QNetworkReply* ownCloudInfo::mkdirRequest( const QString& dir )
qDebug() << "OCInfo Making dir " << dir;
_authAttempts = 0;
QNetworkRequest req;
QUrl url( webdavUrl(_connection) );
// ensure #, ? and co are interpreted as part of the path and nothing else
QUrl url = QUrl(webdavUrl(_connection));
url.setEncodedPath(url.encodedPath()+QUrl::toPercentEncoding(dir, "/"));
req.setUrl( url );
@@ -163,7 +162,7 @@ QNetworkReply* ownCloudInfo::mkdirRequest( const QString& dir )
QNetworkReply* ownCloudInfo::getQuotaRequest( const QString& dir )
{
QNetworkRequest req;
req.setUrl( QUrl( webdavUrl(_connection) + QUrl::toPercentEncoding(dir, "/") ) );
req.setUrl( QUrl( webdavUrl(_connection) + dir ) );
req.setRawHeader("Depth", "0");
QByteArray xml("<?xml version=\"1.0\" ?>\n"
"<d:propfind xmlns:d=\"DAV:\">\n"
@@ -191,10 +190,7 @@ QNetworkReply* ownCloudInfo::getQuotaRequest( const QString& dir )
QNetworkReply* ownCloudInfo::getDirectoryListing( const QString& dir )
{
QNetworkRequest req;
QUrl url( webdavUrl(_connection) );
// ensure #, ? and co are interpreted as part of the path and nothing else
url.setPath(url.path() + dir );
req.setUrl( url );
req.setUrl( QUrl( webdavUrl(_connection) + dir ) );
req.setRawHeader("Depth", "1");
QByteArray xml("<?xml version=\"1.0\" ?>\n"
"<d:propfind xmlns:d=\"DAV:\">\n"
+1 -8
Ver Arquivo
@@ -63,15 +63,8 @@ OwncloudSetupWizard::~OwncloudSetupWizard()
void OwncloudSetupWizard::runWizard(QObject* obj, const char* amember, QWidget *parent)
{
static QPointer<OwncloudSetupWizard> wiz;
if (!wiz.isNull()) {
return;
}
wiz = new OwncloudSetupWizard(parent);
OwncloudSetupWizard *wiz = new OwncloudSetupWizard(parent);
connect( wiz, SIGNAL(ownCloudWizardDone(int)), obj, amember);
connect( wiz, SIGNAL(ownCloudWizardDone(int)), wiz, SLOT(deleteLater()));
FolderMan::instance()->setSyncEnabled(false);
wiz->startWizard();
}
-6
Ver Arquivo
@@ -171,17 +171,11 @@ void ProgressDispatcher::setProgressInfo(const QString& folder, const Progress::
} else {
if( newProgress.kind == Progress::StartSync ) {
_recentProblems.clear();
_timer.start();
}
if( newProgress.kind == Progress::EndSync ) {
newProgress.overall_current_bytes = newProgress.overall_transmission_size;
newProgress.current_file_no = newProgress.overall_file_count;
_currentAction.remove(newProgress.folder);
qint64 msecs = _timer.elapsed();
qDebug()<< "[PROGRESS] progressed " << newProgress.overall_transmission_size
<< " bytes in " << newProgress.overall_file_count << " files"
<< " in msec " << msecs;
}
if( newProgress.kind == Progress::EndDownload ||
newProgress.kind == Progress::EndUpload ||
-3
Ver Arquivo
@@ -18,7 +18,6 @@
#include <QHash>
#include <QTime>
#include <QQueue>
#include <QElapsedTimer>
namespace Mirall {
@@ -117,8 +116,6 @@ private:
QList<Progress::SyncProblem> _recentProblems;
QHash<QString, Progress::Kind> _currentAction;
QElapsedTimer _timer;
static ProgressDispatcher* _instance;
};
+3 -36
Ver Arquivo
@@ -95,29 +95,15 @@ SettingsDialog::SettingsDialog(Application *app, QWidget *parent) :
connect(showLogWindow, SIGNAL(triggered()), app, SLOT(slotOpenLogBrowser()));
addAction(showLogWindow);
int iconSize = 32;
QListWidget *listWidget = _ui->labelWidget;
int spacing = 20;
// reverse at least ~8 characters
int effectiveWidth = fontMetrics().averageCharWidth() * 8 + iconSize + spacing;
// less than ~16 characters, elide otherwise
int maxWidth = fontMetrics().averageCharWidth() * 16 + iconSize + spacing;
for (int i = 0; i < listWidget->count(); i++) {
QListWidgetItem *item = listWidget->item(i);
QFontMetrics fm(item->font());
int curWidth = fm.width(item->text()) + iconSize + spacing;
effectiveWidth = qMax(curWidth, effectiveWidth);
if (curWidth > maxWidth) item->setToolTip(item->text());
}
effectiveWidth = qMin(effectiveWidth, maxWidth);
listWidget->setFixedWidth(effectiveWidth);
MirallConfigFile cfg;
cfg.restoreGeometry(this);
}
SettingsDialog::~SettingsDialog()
{
MirallConfigFile cfg;
cfg.saveGeometry(this);
delete _ui;
}
@@ -137,23 +123,4 @@ void SettingsDialog::slotUpdateAccountState()
_accountItem->setIcon(Theme::instance()->syncStateIcon(state.status()));
}
void SettingsDialog::setGeneralErrors(const QStringList &errors)
{
_accountSettings->setGeneralErrors(errors);
}
// close event is not being called here
void SettingsDialog::reject() {
MirallConfigFile cfg;
cfg.saveGeometry(this);
QDialog::reject();
}
void SettingsDialog::accept() {
MirallConfigFile cfg;
cfg.saveGeometry(this);
QDialog::accept();
}
} // namespace Mirall
+1 -5
Ver Arquivo
@@ -40,11 +40,6 @@ public:
~SettingsDialog();
void addAccount(const QString &title, QWidget *widget);
void setGeneralErrors( const QStringList& errors );
protected:
void reject();
void accept();
protected slots:
void slotUpdateAccountState();
@@ -53,6 +48,7 @@ private:
Ui::SettingsDialog *_ui;
AccountSettings *_accountSettings;
QListWidgetItem *_accountItem;
};
}
+16 -1
Ver Arquivo
@@ -14,7 +14,16 @@
<string>Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
@@ -28,6 +37,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="0" column="1">
+4 -4
Ver Arquivo
@@ -22,13 +22,13 @@
class QSslError;
class QSslCertificate;
namespace Mirall
{
namespace Ui {
class SslErrorDialog;
}
namespace Mirall
{
class SslErrorDialog : public QDialog
{
Q_OBJECT
@@ -57,7 +57,7 @@ private:
QList<QSslCertificate> _unknownCerts;
QString _customConfigHandle;
Ui::SslErrorDialog *_ui;
::Ui::SslErrorDialog *_ui;
};
} // end namespace
+2 -2
Ver Arquivo
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Mirall::SslErrorDialog</class>
<widget class="QWidget" name="Mirall::SslErrorDialog">
<class>SslErrorDialog</class>
<widget class="QWidget" name="SslErrorDialog">
<property name="geometry">
<rect>
<x>0</x>
-13
Ver Arquivo
@@ -1,16 +1,3 @@
/*
* Copyright (C) by Klaas Freitag <freitag@owncloud.com>
*
* 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 SYNCFILEITEM_H
#define SYNCFILEITEM_H
+4 -14
Ver Arquivo
@@ -27,7 +27,6 @@
#ifdef Q_OS_UNIX
#include <sys/statvfs.h>
#include <sys/types.h>
#include <unistd.h>
#endif
#include <stdarg.h>
@@ -38,7 +37,6 @@
#elif defined(Q_OS_WIN)
#include <shlobj.h>
#include <winbase.h>
#include <windows.h>
#endif
namespace Mirall {
@@ -105,10 +103,10 @@ void Utility::setupFavLink(const QString &folder)
QString Utility::octetsToString( qint64 octets )
{
static const qint64 kb = 1024;
static const qint64 mb = 1024 * kb;
static const qint64 gb = 1024 * mb;
static const qint64 tb = 1024 * gb;
static const qint64 kb = 1000;
static const qint64 mb = 1000 * kb;
static const qint64 gb = 1000 * mb;
static const qint64 tb = 1000 * gb;
QString s;
qreal value = octets;
@@ -368,12 +366,4 @@ QString Utility::toCSyncScheme(const QString &urlStr)
return url.toString();
}
void Utility::sleep(int sec)
{
#ifdef Q_OS_WIN
::Sleep(sec*1000);
#else
::sleep(sec);
#endif
}
} // namespace Mirall
-1
Ver Arquivo
@@ -23,7 +23,6 @@ namespace Mirall {
namespace Utility
{
void sleep(int sec);
QString formatFingerprint( const QByteArray& );
void setupFavLink( const QString &folder );
QString octetsToString( qint64 octets );
+3 -3
Ver Arquivo
@@ -17,7 +17,6 @@
#include <QDir>
#include <QFileDialog>
#include <QUrl>
#include <QTimer>
#include "QProgressIndicator.h"
@@ -27,6 +26,7 @@
#include "mirall/theme.h"
#include "mirall/mirallconfigfile.h"
#include "creds/abstractcredentials.h"
namespace Mirall
{
@@ -89,8 +89,8 @@ void OwncloudAdvancedSetupPage::initializePage()
// call to init label
updateStatus();
// ensure "next" gets the focus, not obSelectLocalFolder
QTimer::singleShot(0, wizard()->button(QWizard::NextButton), SLOT(setFocus()));
// TODO: focus
_ui.pbSelectLocalFolder->setFocus();
}
// Called if the user changes the user- or url field. Adjust the texts and
+1 -1
Ver Arquivo
@@ -76,7 +76,7 @@
</sizepolicy>
</property>
<property name="toolTip">
<string>Enter the URL of the server that you want to connect to (without http or https).</string>
<string>Enter the url of the ownCloud you want to connect to (without http or https).</string>
</property>
<property name="placeholderText">
<string>https://...</string>
+2 -3
Ver Arquivo
@@ -41,7 +41,7 @@ OwncloudSetupPage::OwncloudSetupPage()
Theme *theme = Theme::instance();
setTitle(WizardCommon::titleTemplate().arg(tr("Connect to %1").arg(theme->appNameGUI())));
setSubTitle(WizardCommon::subTitleTemplate().arg(tr("Setup %1 server").arg(theme->appNameGUI())));
setSubTitle(WizardCommon::subTitleTemplate().arg(tr("Setup ownCloud server")));
registerField( QLatin1String("OCUrl*"), _ui.leUrl );
@@ -227,8 +227,7 @@ void OwncloudSetupPage::setConfigExists( bool config )
_configExists = config;
if (config == true) {
setSubTitle(WizardCommon::subTitleTemplate().arg(tr("Update %1 server")
.arg(Theme::instance()->appNameGUI())));
setSubTitle(WizardCommon::subTitleTemplate().arg(tr("Update ownCloud server")));
}
}
+1 -2
Ver Arquivo
@@ -78,8 +78,7 @@ void OwncloudWizardResultPage::initializePage()
text = tr("Your entire account is synced to the local folder <i>%1</i>")
.arg(QDir::toNativeSeparators(localFolder));
} else {
text = tr("%1 folder <i>%1</i> is synced to local folder <i>%2</i>")
.arg(Theme::instance()->appNameGUI())
text = tr("ownCloud folder <i>%1</i> is synced to local folder <i>%2</i>")
.arg(_remoteFolder).arg(QDir::toNativeSeparators(localFolder));
}
_ui.localFolderLabel->setText( text );
+10 -14
Ver Arquivo
@@ -26,31 +26,27 @@ private slots:
}
void testOctetsToString()
{
QLocale::setDefault(QLocale("en"));
QCOMPARE(octetsToString(999) , QString("999 B"));
QCOMPARE(octetsToString(1000) , QString("1,000 B"));
QCOMPARE(octetsToString(1010) , QString("1,010 B"));
QCOMPARE(octetsToString(1024) , QString("1 kB"));
QCOMPARE(octetsToString(1000) , QString("1 kB"));
QCOMPARE(octetsToString(1010) , QString("1 kB"));
QCOMPARE(octetsToString(1110) , QString("1.1 kB"));
QCOMPARE(octetsToString(9110) , QString("8.9 kB"));
QCOMPARE(octetsToString(9910) , QString("9.7 kB"));
QCOMPARE(octetsToString(9999) , QString("9.8 kB"));
QCOMPARE(octetsToString(10240) , QString("10 kB"));
QCOMPARE(octetsToString(9110) , QString("9.1 kB"));
QCOMPARE(octetsToString(9910) , QString("9.9 kB"));
QCOMPARE(octetsToString(9999) , QString("10 kB"));
QCOMPARE(octetsToString(123456) , QString("121 kB"));
QCOMPARE(octetsToString(123456) , QString("123 kB"));
QCOMPARE(octetsToString(1234567) , QString("1.2 MB"));
QCOMPARE(octetsToString(12345678) , QString("12 MB"));
QCOMPARE(octetsToString(123456789) , QString("118 MB"));
QCOMPARE(octetsToString(1000LL*1000*1000 * 5) , QString("4.7 GB"));
QCOMPARE(octetsToString(1024LL*1024*1024 * 5) , QString("5 GB"));
QCOMPARE(octetsToString(123456789) , QString("123 MB"));
QCOMPARE(octetsToString(1000LL*1000*1000 * 5) , QString("5 GB"));
QCOMPARE(octetsToString(1), QString("1 B"));
QCOMPARE(octetsToString(2), QString("2 B"));
QCOMPARE(octetsToString(1024), QString("1 kB"));
QCOMPARE(octetsToString(1024*1024), QString("1 MB"));
QCOMPARE(octetsToString(1024LL*1024*1024), QString("1 GB"));
QCOMPARE(octetsToString(1024LL*1024*1024*1024), QString("1 TB"));
QCOMPARE(octetsToString(1024LL*1024*1024), QString("1.1 GB"));
QCOMPARE(octetsToString(1024LL*1024*1024*1024), QString("1.1 TB"));
}
void testLaunchOnStartup()
Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 781 B

Depois

Largura:  |  Altura:  |  Tamanho: 739 B