Fixed sync start after ownCloud initial configuration.

This commit is contained in:
Klaas Freitag 2012-04-02 13:21:13 +02:00
parent eb1fd2d5f8
commit 596e824b54
3 changed files with 11 additions and 13 deletions

View file

@ -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 ) );
}

View file

@ -312,7 +312,7 @@ void FolderMan::slotFolderSyncFinished( const SyncResult& )
* QString targetPath on remote
* bool onlyThisLAN, currently unused.
*/
Folder* FolderMan::addFolderDefinition( const QString& backend, const QString& alias,
void FolderMan::addFolderDefinition( const QString& backend, const QString& alias,
const QString& sourceFolder, const QString& targetPath,
bool onlyThisLAN )
{
@ -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 )

View file

@ -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<QString, bool> _folderEnabledMap;