Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
KDebugSettings
Commits
bafc2113
Commit
bafc2113
authored
Dec 24, 2020
by
Laurent Montel
😁
Browse files
Start to fix duplicate name
parent
c75d4b70
Pipeline
#45237
passed with stage
in 9 minutes and 50 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/loadgroupmenu.cpp
View file @
bafc2113
...
...
@@ -50,19 +50,20 @@ QString LoadGroupMenu::defaultWritableGroupPath()
void
LoadGroupMenu
::
init
()
{
//Load all ?
mGroupNames
.
clear
();
const
QString
groupPath
=
LoadGroupMenu
::
defaultWritableGroupPath
();
if
(
groupPath
.
isEmpty
())
{
setEnabled
(
false
);
return
;
}
QDir
dir
(
groupPath
);
const
QStringList
group
s
=
dir
.
entryList
(
QDir
::
Files
|
QDir
::
NoDotAndDotDot
);
if
(
g
roups
.
isEmpty
())
{
mGroupName
s
=
dir
.
entryList
(
QDir
::
Files
|
QDir
::
NoDotAndDotDot
);
if
(
mG
roup
Name
s
.
isEmpty
())
{
setEnabled
(
false
);
return
;
}
setEnabled
(
true
);
for
(
const
QString
&
file
:
g
roups
)
{
for
(
const
QString
&
file
:
mG
roup
Name
s
)
{
QAction
*
act
=
addAction
(
file
);
const
QString
fullPath
=
groupPath
+
QLatin1Char
(
'/'
)
+
file
;
connect
(
act
,
&
QAction
::
triggered
,
this
,
[
this
,
fullPath
]
{
...
...
@@ -73,3 +74,13 @@ void LoadGroupMenu::init()
QAction
*
manageGroup
=
addAction
(
i18n
(
"Manage Group"
));
connect
(
manageGroup
,
&
QAction
::
triggered
,
this
,
&
LoadGroupMenu
::
manageGroupRequested
);
}
QStringList
LoadGroupMenu
::
groupNames
()
const
{
return
mGroupNames
;
}
void
LoadGroupMenu
::
setGroupNames
(
const
QStringList
&
groupNames
)
{
mGroupNames
=
groupNames
;
}
src/loadgroupmenu.h
View file @
bafc2113
...
...
@@ -34,12 +34,16 @@ public:
static
Q_REQUIRED_RESULT
QString
defaultWritableGroupPath
();
Q_REQUIRED_RESULT
QStringList
groupNames
()
const
;
void
setGroupNames
(
const
QStringList
&
groupNames
);
Q_SIGNALS:
void
loadGroupRequested
(
const
QString
&
filePath
);
void
manageGroupRequested
();
private:
void
init
();
QStringList
mGroupNames
;
};
#endif // LOADGROUPMENU_H
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment