diff --git a/src/RemoteModel.cpp b/src/RemoteModel.cpp index de850206..b5311413 100644 --- a/src/RemoteModel.cpp +++ b/src/RemoteModel.cpp @@ -110,6 +110,13 @@ RemoteModel::~RemoteModel() void RemoteModel::setNewRootDir(const QString& url, const QString& cert) { + // Extract user name + QString cn = remoteDatabase.clientCertificates()[cert].subjectInfo(QSslCertificate::CommonName).at(0); + QStringList cn_parts = cn.split("@"); + if(cn_parts.size() < 2) + return; + currentUserName = cn_parts.first(); + // Save settings currentRootDirectory = url; currentClientCert = cert; @@ -194,7 +201,9 @@ QVariant RemoteModel::data(const QModelIndex& index, int role) const if(role == Qt::DecorationRole && index.column() == 0) { // Use different icons depending on item type - if(type == "folder") + if(type == "folder" && index.parent() == QModelIndex() && item->value(RemoteModelColumnName) == currentUserName) + return QImage(":/icons/folder_user"); + else if(type == "folder") return QImage(":/icons/folder"); else if(type == "database") return QImage(":/icons/database"); diff --git a/src/RemoteModel.h b/src/RemoteModel.h index 4d62ec6d..65945f00 100644 --- a/src/RemoteModel.h +++ b/src/RemoteModel.h @@ -105,6 +105,7 @@ private: // lazy population. QString currentRootDirectory; QString currentClientCert; + QString currentUserName; }; #endif diff --git a/src/icons/folder_user.png b/src/icons/folder_user.png new file mode 100644 index 00000000..f021c3e1 Binary files /dev/null and b/src/icons/folder_user.png differ diff --git a/src/icons/icons.qrc b/src/icons/icons.qrc index 24e7b26d..6cc06d50 100644 --- a/src/icons/icons.qrc +++ b/src/icons/icons.qrc @@ -55,5 +55,6 @@ database.png cog_go.png page_paste.png + folder_user.png