mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 21:15:55 +03:00
parent
3b59960fb3
commit
6152ce4187
4 changed files with 16 additions and 2 deletions
|
@ -177,6 +177,19 @@ void Folder::checkLocalPath()
|
|||
}
|
||||
}
|
||||
|
||||
QString Folder::aliasGui() const
|
||||
{
|
||||
if (remotePath().length() > 0 && remotePath() != QLatin1String("/")) {
|
||||
QString a = QFile(remotePath()).fileName();
|
||||
if (a.startsWith('/')) {
|
||||
a = a.remove(0, 1);
|
||||
}
|
||||
return a;
|
||||
} else {
|
||||
return Theme::instance()->appNameGUI();
|
||||
}
|
||||
}
|
||||
|
||||
QString Folder::alias() const
|
||||
{
|
||||
return _definition.alias;
|
||||
|
|
|
@ -101,6 +101,7 @@ 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
|
||||
|
||||
/**
|
||||
* local folder path
|
||||
|
|
|
@ -156,7 +156,7 @@ QVariant FolderStatusModel::data(const QModelIndex &index, int role) const
|
|||
switch (role) {
|
||||
case FolderStatusDelegate::FolderPathRole : return f->nativePath();
|
||||
case FolderStatusDelegate::FolderSecondPathRole : return f->remotePath();
|
||||
case FolderStatusDelegate::FolderAliasRole : return f->alias();
|
||||
case FolderStatusDelegate::FolderAliasRole : return f->aliasGui();
|
||||
case FolderStatusDelegate::FolderSyncPaused : return f->syncPaused();
|
||||
case FolderStatusDelegate::FolderAccountConnected : return accountConnected;
|
||||
case Qt::ToolTipRole:
|
||||
|
|
|
@ -342,7 +342,7 @@ void ownCloudGui::addAccountContextMenu(AccountStatePtr accountState, QMenu *men
|
|||
folderName = Theme::instance()->appNameGUI();
|
||||
}
|
||||
|
||||
QAction *action = new QAction( tr("Open folder '%1'").arg(folder->alias()), this );
|
||||
QAction *action = new QAction( tr("Open folder '%1'").arg(folder->path()), this );
|
||||
connect(action, SIGNAL(triggered()),_folderOpenActionMapper, SLOT(map()));
|
||||
_folderOpenActionMapper->setMapping( action, folder->alias() );
|
||||
menu->addAction(action);
|
||||
|
|
Loading…
Reference in a new issue