diff --git a/src/mirall/application.cpp b/src/mirall/application.cpp index 3784e0992..07f1b93d3 100644 --- a/src/mirall/application.cpp +++ b/src/mirall/application.cpp @@ -167,6 +167,7 @@ void Application::slotNoOwnCloudFound( QNetworkReply::NetworkError err ) _actionAddFolder->setEnabled( false ); setupContextMenu(); } + void Application::slotCheckAuthentication() { _ocInfo->getRequest("/", true ); // this call needs to be authenticated. @@ -332,6 +333,7 @@ void Application::slotAddFolder() if( goodData ) { _folderMan->addFolderDefinition( backend, alias, sourceFolder, targetPath, onlyThisLAN ); + _folderMan->setupFolderFromConfigFile( alias ); _statusDialog->slotAddFolder( _folderMan->folder( alias ) ); } diff --git a/src/mirall/folderman.cpp b/src/mirall/folderman.cpp index 147a4ef1a..37733e1a4 100644 --- a/src/mirall/folderman.cpp +++ b/src/mirall/folderman.cpp @@ -312,9 +312,9 @@ void FolderMan::slotFolderSyncFinished( const SyncResult& ) * QString targetPath on remote * bool onlyThisLAN, currently unused. */ -Folder* FolderMan::addFolderDefinition( const QString& backend, const QString& alias, - const QString& sourceFolder, const QString& targetPath, - bool onlyThisLAN ) +void FolderMan::addFolderDefinition( const QString& backend, const QString& alias, + const QString& sourceFolder, const QString& targetPath, + bool onlyThisLAN ) { // Create a settings file named after the alias QSettings settings( _folderConfigPath + "/" + alias, QSettings::IniFormat); @@ -326,10 +326,6 @@ Folder* FolderMan::addFolderDefinition( const QString& backend, const QString& a settings.setValue(QString("%1/onlyThisLAN").arg(alias), onlyThisLAN ); settings.sync(); - Folder *folder = setupFolderFromConfigFile(alias); - // setupContextMenu(); FIXME: Refresh GUI elements. - - return folder; } void FolderMan::slotRemoveFolder( const QString& alias ) diff --git a/src/mirall/folderman.h b/src/mirall/folderman.h index e540f625a..cf229c8e2 100644 --- a/src/mirall/folderman.h +++ b/src/mirall/folderman.h @@ -51,7 +51,7 @@ public: * QString targetPath on remote * bool onlyThisLAN, currently unused. */ - Folder *addFolderDefinition( const QString&, const QString&, const QString&, const QString&, bool ); + void addFolderDefinition( const QString&, const QString&, const QString&, const QString&, bool ); /** * return the folder by alias or NULL if no folder with the alias exists. @@ -63,6 +63,11 @@ public: */ SyncResult syncResult( const QString& ); + /** + * creates a folder for a specific configuration, identified by alias. + */ + Folder* setupFolderFromConfigFile(const QString & ); + signals: /** * signal to indicate a folder named by alias has changed its sync state. @@ -93,11 +98,6 @@ private: void removeFolder( const QString& ); - - // creates a folder for a specific - // configuration - Folder* setupFolderFromConfigFile(const QString & ); - FolderWatcher *_configFolderWatcher; Folder::Map _folderMap; QHash _folderEnabledMap;