[Pkg-owncloud-commits] [owncloud-client] 401/470: UI: Fix account name/alias display oddities #4577
Sandro Knauß
hefee-guest at moszumanska.debian.org
Thu May 12 16:25:32 UTC 2016
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit ce5ca8a42e5456a1d557575a7e1718638a8eaefe
Author: Markus Goetz <markus at woboq.com>
Date: Tue Apr 26 16:38:03 2016 +0200
UI: Fix account name/alias display oddities #4577
---
src/gui/accountsettings.cpp | 4 ++--
src/gui/folder.cpp | 8 ++++----
src/gui/folder.h | 6 +++---
src/gui/folderman.cpp | 2 +-
src/gui/folderstatusmodel.cpp | 4 ++--
src/gui/owncloudgui.cpp | 4 ++--
src/gui/protocolwidget.cpp | 2 +-
7 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp
index dfb4654..a2652e0 100644
--- a/src/gui/accountsettings.cpp
+++ b/src/gui/accountsettings.cpp
@@ -335,12 +335,12 @@ void AccountSettings::slotRemoveCurrentFolder()
qDebug() << "Remove Folder alias " << alias;
if( !alias.isEmpty() ) {
FolderMan *folderMan = FolderMan::instance();
- QString aliasGui = folderMan->folder(alias)->aliasGui();
+ QString shortGuiLocalPath = folderMan->folder(alias)->shortGuiLocalPath();
QMessageBox messageBox(QMessageBox::Question,
tr("Confirm Folder Sync Connection Removal"),
tr("<p>Do you really want to stop syncing the folder <i>%1</i>?</p>"
- "<p><b>Note:</b> This will <b>not</b> delete any files.</p>").arg(aliasGui),
+ "<p><b>Note:</b> This will <b>not</b> delete any files.</p>").arg(shortGuiLocalPath),
QMessageBox::NoButton,
this);
QPushButton* yesButton =
diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp
index 6ab67cb..a5825e9 100644
--- a/src/gui/folder.cpp
+++ b/src/gui/folder.cpp
@@ -142,7 +142,7 @@ void Folder::checkLocalPath()
}
}
-QString Folder::aliasGui() const
+QString Folder::shortGuiRemotePathOrAppName() const
{
if (remotePath().length() > 0 && remotePath() != QLatin1String("/")) {
QString a = QFile(remotePath()).fileName();
@@ -169,7 +169,7 @@ QString Folder::path() const
return p;
}
-QString Folder::shortGuiPath() const
+QString Folder::shortGuiLocalPath() const
{
QString p = _definition.localPath;
QString home = QDir::homePath();
@@ -975,7 +975,7 @@ void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction, bool *cancel)
"the files were manually removed.\n"
"Are you sure you want to perform this operation?");
QMessageBox msgBox(QMessageBox::Warning, tr("Remove All Files?"),
- msg.arg(aliasGui()));
+ msg.arg(shortGuiLocalPath()));
msgBox.addButton(tr("Remove all files"), QMessageBox::DestructiveRole);
QPushButton* keepBtn = msgBox.addButton(tr("Keep files"), QMessageBox::AcceptRole);
if (msgBox.exec() == -1) {
@@ -1001,7 +1001,7 @@ void Folder::slotAboutToRestoreBackup(bool *restore)
"file in an earlier state. "
"Do you want to keep your local most recent files as conflict files?");
QMessageBox msgBox(QMessageBox::Warning, tr("Backup detected"),
- msg.arg(aliasGui()));
+ msg.arg(shortGuiLocalPath()));
msgBox.addButton(tr("Normal Synchronisation"), QMessageBox::DestructiveRole);
QPushButton* keepBtn = msgBox.addButton(tr("Keep Local Files as Conflict"), QMessageBox::AcceptRole);
diff --git a/src/gui/folder.h b/src/gui/folder.h
index c0c3580..b6928aa 100644
--- a/src/gui/folder.h
+++ b/src/gui/folder.h
@@ -95,12 +95,12 @@ public:
* alias or nickname
*/
QString alias() const;
- QString aliasGui() const; // since 2.0 we don't want to show aliases anymore, show the path instead
+ QString shortGuiRemotePathOrAppName() const; // since 2.0 we don't want to show aliases anymore, show the path instead
/**
- * short path to display on the GUI (native separators)
+ * short local path to display on the GUI (native separators)
*/
- QString shortGuiPath() const;
+ QString shortGuiLocalPath() const;
/**
* local folder path
diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp
index 8c51681..ac623c1 100644
--- a/src/gui/folderman.cpp
+++ b/src/gui/folderman.cpp
@@ -781,7 +781,7 @@ Folder* FolderMan::addFolderInternal(const FolderDefinition& folderDefinition, A
{
auto folder = new Folder(folderDefinition, accountState, this );
- qDebug() << "Adding folder to Folder Map " << folder;
+ qDebug() << "Adding folder to Folder Map " << folder << folder->alias();
_folderMap[folder->alias()] = folder;
if (folder->syncPaused()) {
_disabledFolders.insert(folder);
diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp
index 7fb8d9d..55f35b4 100644
--- a/src/gui/folderstatusmodel.cpp
+++ b/src/gui/folderstatusmodel.cpp
@@ -185,11 +185,11 @@ QVariant FolderStatusModel::data(const QModelIndex &index, int role) const
const bool accountConnected = _accountState->isConnected();
switch (role) {
- case FolderStatusDelegate::FolderPathRole : return f->shortGuiPath();
+ case FolderStatusDelegate::FolderPathRole : return f->shortGuiLocalPath();
case FolderStatusDelegate::FolderSecondPathRole : return f->remotePath();
case FolderStatusDelegate::FolderErrorMsg : return f->syncResult().errorStrings();
case FolderStatusDelegate::SyncRunning : return f->syncResult().status() == SyncResult::SyncRunning;
- case FolderStatusDelegate::HeaderRole : return f->aliasGui();
+ case FolderStatusDelegate::HeaderRole : return f->shortGuiRemotePathOrAppName();
case FolderStatusDelegate::FolderAliasRole : return f->alias();
case FolderStatusDelegate::FolderSyncPaused : return f->syncPaused();
case FolderStatusDelegate::FolderAccountConnected : return accountConnected;
diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp
index 6935883..d329954 100644
--- a/src/gui/owncloudgui.cpp
+++ b/src/gui/owncloudgui.cpp
@@ -314,7 +314,7 @@ void ownCloudGui::slotComputeOverallSyncStatus()
foreach(Folder* folder, map.values()) {
//qDebug() << "Folder in overallStatus Message: " << folder << " with name " << folder->alias();
QString folderMessage = folderMan->statusToString(folder->syncResult().status(), folder->syncPaused());
- allStatusStrings += tr("Folder %1: %2").arg(folder->aliasGui(), folderMessage);
+ allStatusStrings += tr("Folder %1: %2").arg(folder->shortGuiLocalPath(), folderMessage);
}
trayMessage = allStatusStrings.join(QLatin1String("\n"));
#endif
@@ -367,7 +367,7 @@ void ownCloudGui::addAccountContextMenu(AccountStatePtr accountState, QMenu *men
menu->addAction(tr("Managed Folders:"))->setDisabled(true);
}
- QAction *action = new QAction( tr("Open folder '%1'").arg(folder->shortGuiPath()), this );
+ QAction *action = new QAction( tr("Open folder '%1'").arg(folder->shortGuiLocalPath()), this );
connect(action, SIGNAL(triggered()),_folderOpenActionMapper, SLOT(map()));
_folderOpenActionMapper->setMapping( action, folder->alias() );
menu->addAction(action);
diff --git a/src/gui/protocolwidget.cpp b/src/gui/protocolwidget.cpp
index e07b994..5a175af 100644
--- a/src/gui/protocolwidget.cpp
+++ b/src/gui/protocolwidget.cpp
@@ -167,7 +167,7 @@ QTreeWidgetItem* ProtocolWidget::createCompletedTreewidgetItem(const QString& fo
columns << timeStr;
columns << Utility::fileNameForGuiUse(item._originalFile);
- columns << f->shortGuiPath();
+ columns << f->shortGuiLocalPath();
// If the error string is set, it's prefered because it is a useful user message.
QString message = item._errorString;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list