]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
UI: Fix account name/alias display oddities #4577
authorMarkus Goetz <markus@woboq.com>
Tue, 26 Apr 2016 14:38:03 +0000 (16:38 +0200)
committerMarkus Goetz <markus@woboq.com>
Tue, 26 Apr 2016 14:47:47 +0000 (16:47 +0200)
src/gui/accountsettings.cpp
src/gui/folder.cpp
src/gui/folder.h
src/gui/folderman.cpp
src/gui/folderstatusmodel.cpp
src/gui/owncloudgui.cpp
src/gui/protocolwidget.cpp

index dfb4654acc63c569563a545c28d8f822792b2d13..a2652e0b758e257ad39a53b2f6568bbc7836548b 100644 (file)
@@ -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 =
index 6ab67cba3d65fa9b493351f9600ef92da69e2797..a5825e9f77e94efa166080034c998fc27a598ecd 100644 (file)
@@ -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);
 
index c0c3580c9030fa79aa3cab646d1d70de9bda072b..b6928aa38bb242662365348086b491cea2ed8019 100644 (file)
@@ -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
index 8c5168171adccbafec975ba5e5adc7279af7c07c..ac623c118820a71f3021f4f399d56db38c013a3a 100644 (file)
@@ -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);
index 7fb8d9db041f3e6fbdcacb845847cc0597900792..55f35b43b2754eb9a1aadd1fdbd435e1b52b6c12 100644 (file)
@@ -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;
index 69358835f4e004c13678b79ba776b00feafcbed0..d32995455539cca3e77b1665841f7d387b0f7012 100644 (file)
@@ -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);
index e07b99409c7d20a3fdfa65c02dcd3cd5b7f80359..5a175afed6e5d52a65687041902a74404cb3eb5a 100644 (file)
@@ -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;