Commit d12d1b98 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Continue to implement group menu

parent f1c62778
Pipeline #44366 passed with stage
in 8 minutes and 59 seconds
......@@ -20,6 +20,9 @@
#include "loadgroupmenu.h"
#include <QDir>
#include <QStandardPaths>
LoadGroupMenu::LoadGroupMenu(QWidget *parent)
: QMenu(parent)
{
......@@ -30,7 +33,24 @@ LoadGroupMenu::~LoadGroupMenu()
{
}
void LoadGroupMenu::init()
void LoadGroupMenu::refreshMenu()
{
clear();
init();
}
void LoadGroupMenu::init()
{
const QString groupPath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QLatin1String("/groups");
if (groupPath.isEmpty()) {
setEnabled(false);
return;
}
QDir dir(groupPath);
const QStringList groups = dir.entryList(QDir::Files | QDir::NoDotAndDotDot);
for (const QString &file : groups) {
//TODO add connect etc.
//TODO groupPath + file.
addAction(file);
}
}
......@@ -29,6 +29,12 @@ class LIBKDEBUGSETTINGS_EXPORT_TEST_EXPORT LoadGroupMenu : public QMenu
public:
explicit LoadGroupMenu(QWidget *parent = nullptr);
~LoadGroupMenu() override;
void refreshMenu();
Q_SIGNALS:
void loadGroupRequested(const QString &filePath);
private:
void init();
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment