Skip to content

Commit

Permalink
[FIX] [MTP] could not run the file as an administrator
Browse files Browse the repository at this point in the history
[LINK] 29142
  • Loading branch information
dingjingmaster committed Jan 27, 2021
1 parent be68af8 commit ac27a67
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion peony-admin/admin-menu-plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ AdminMenuPlugin::AdminMenuPlugin(QObject *parent) : QObject(parent)

QList<QAction *> AdminMenuPlugin::menuActions(Types types, const QString &uri, const QStringList &selectionUris)
{
QList<QAction *> l;
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QList<QAction *> l;

if (uri.startsWith("mtp://")) {
return l;
}

if (selectionUris.isEmpty()) {
auto directoryAction = new QAction(tr("Open Directory as Admin"));
l<<directoryAction;
Expand Down
2 changes: 1 addition & 1 deletion peony-admin/admin-menu-plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AdminMenuPlugin : public QObject, public MenuPluginInterface
QList<QAction *> menuActions(Types types, const QString &uri, const QStringList &selectionUris) override;

private:
bool m_enable;
bool m_enable;
};

}
Expand Down

0 comments on commit ac27a67

Please sign in to comment.