From de2335c1dbd84df80811736d817d9cd8d1ce1f84 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 26 Mar 2014 19:30:13 +0100 Subject: [PATCH] Show the folders when in the accountsettings in the first start --- src/mirall/accountsettings.cpp | 4 ++++ src/mirall/accountsettings.h | 2 +- src/mirall/folderman.cpp | 3 +++ src/mirall/folderman.h | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mirall/accountsettings.cpp b/src/mirall/accountsettings.cpp index 3151ea21f..0c1b63616 100644 --- a/src/mirall/accountsettings.cpp +++ b/src/mirall/accountsettings.cpp @@ -111,7 +111,10 @@ AccountSettings::AccountSettings(QWidget *parent) : this, SLOT(slotAccountChanged(Account*,Account*))); slotAccountChanged(AccountManager::instance()->account(), 0); + connect(FolderMan::instance(), SIGNAL(folderListLoaded(Folder::Map)), + this, SLOT(setFolderList(Folder::Map))); setFolderList(FolderMan::instance()->map()); + } void AccountSettings::slotAccountChanged(Account *newAccount, Account *oldAccount) @@ -132,6 +135,7 @@ void AccountSettings::slotAccountChanged(Account *newAccount, Account *oldAccoun this, SLOT(slotUpdateQuota(qint64,qint64))); slotUpdateQuota(quotaInfo->lastQuotaTotalBytes(), quotaInfo->lastQuotaUsedBytes()); } + } void AccountSettings::slotFolderActivated( const QModelIndex& indx ) diff --git a/src/mirall/accountsettings.h b/src/mirall/accountsettings.h index 97751e92d..fd36a2f24 100644 --- a/src/mirall/accountsettings.h +++ b/src/mirall/accountsettings.h @@ -48,7 +48,6 @@ public: explicit AccountSettings(QWidget *parent = 0); ~AccountSettings(); - void setFolderList( const Folder::Map& ); signals: void folderChanged(); @@ -70,6 +69,7 @@ public slots: void slotAccountStateChanged(int state); void setGeneralErrors( const QStringList& errors ); + void setFolderList( const Folder::Map& ); protected slots: void slotAddFolder(); diff --git a/src/mirall/folderman.cpp b/src/mirall/folderman.cpp index d0ab52868..c4a5a2e47 100644 --- a/src/mirall/folderman.cpp +++ b/src/mirall/folderman.cpp @@ -154,6 +154,9 @@ int FolderMan::setupFolders() emit( folderSyncStateChange( f->alias() ) ); } } + + emit folderListLoaded(_folderMap); + // return the number of valid folders. return _folderMap.size(); } diff --git a/src/mirall/folderman.h b/src/mirall/folderman.h index 710be007a..a911b2515 100644 --- a/src/mirall/folderman.h +++ b/src/mirall/folderman.h @@ -89,6 +89,8 @@ signals: */ void folderSyncStateChange( const QString & ); + void folderListLoaded(const Folder::Map &); + public slots: void slotRemoveFolder( const QString& ); void slotEnableFolder( const QString&, bool );