Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
KDebugSettings
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Utilities
KDebugSettings
Commits
3378890d
Commit
3378890d
authored
Feb 24, 2015
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve++
parent
3f4b6c49
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
127 additions
and
3 deletions
+127
-3
CMakeLists.txt
CMakeLists.txt
+2
-1
autotests/CMakeLists.txt
autotests/CMakeLists.txt
+1
-1
autotests/kdeapplicationdebugsettingpagetest.cpp
autotests/kdeapplicationdebugsettingpagetest.cpp
+7
-0
autotests/kdeapplicationlistwidgettest.cpp
autotests/kdeapplicationlistwidgettest.cpp
+7
-0
autotests/kdeapplicationlistwidgettest.h
autotests/kdeapplicationlistwidgettest.h
+2
-0
src/CMakeLists.txt
src/CMakeLists.txt
+1
-1
src/kdeapplicationdebugsettingpage.cpp
src/kdeapplicationdebugsettingpage.cpp
+22
-0
src/kdeapplicationdebugsettingpage.h
src/kdeapplicationdebugsettingpage.h
+6
-0
src/kdebugsettingsdialog.cpp
src/kdebugsettingsdialog.cpp
+19
-0
src/kdebugsettingsdialog.h
src/kdebugsettingsdialog.h
+2
-0
src/kdebugsettingsutil.cpp
src/kdebugsettingsutil.cpp
+28
-0
src/kdebugsettingsutil.h
src/kdebugsettingsutil.h
+30
-0
No files found.
CMakeLists.txt
View file @
3378890d
...
...
@@ -9,7 +9,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_D
find_package
(
Qt5
${
QT_MIN_VERSION
}
REQUIRED NO_MODULE COMPONENTS Widgets Test
)
find_package
(
KF5 REQUIRED COMPONENTS
CoreAddons
Config
Config
ConfigWidgets
DBusAddons
I18n
GuiAddons
...
...
autotests/CMakeLists.txt
View file @
3378890d
...
...
@@ -10,6 +10,7 @@ macro(add_unittest _source _additionalsource)
Qt5::Test
KF5::I18n
Qt5::Widgets
KF5::ConfigCore
)
endmacro
()
...
...
@@ -17,4 +18,3 @@ add_unittest( kdebugsettingsdialogtest.cpp "../src/kdebugsettingsdialog.cpp")
add_unittest
(
kdeapplicationdebugsettingpagetest.cpp
"../src/kdeapplicationdebugsettingpage.cpp"
)
add_unittest
(
customdebugsettingspagetest.cpp
"../src/customdebugsettingspage.cpp"
)
add_unittest
(
kdeapplicationlistwidgettest.cpp
"../src/kdeapplicationlistwidget.cpp"
)
autotests/kdeapplicationdebugsettingpagetest.cpp
View file @
3378890d
...
...
@@ -21,6 +21,7 @@
#include "kdeapplicationdebugsettingpagetest.h"
#include "../src/kdeapplicationdebugsettingpage.h"
#include <qlistwidget.h>
#include <qpushbutton.h>
#include <qtest.h>
KDeApplicationDebugSettingPageTest
::
KDeApplicationDebugSettingPageTest
(
QObject
*
parent
)
...
...
@@ -39,6 +40,12 @@ void KDeApplicationDebugSettingPageTest::shouldHaveDefaultValue()
KDeApplicationDebugSettingPage
page
;
QListWidget
*
listWidget
=
page
.
findChild
<
QListWidget
*>
(
QStringLiteral
(
"listwidget"
));
QVERIFY
(
listWidget
);
QPushButton
*
selectAll
=
page
.
findChild
<
QPushButton
*>
(
QStringLiteral
(
"selectall"
));
QVERIFY
(
selectAll
);
QPushButton
*
deselectAll
=
page
.
findChild
<
QPushButton
*>
(
QStringLiteral
(
"deselectall"
));
QVERIFY
(
deselectAll
);
}
QTEST_MAIN
(
KDeApplicationDebugSettingPageTest
)
autotests/kdeapplicationlistwidgettest.cpp
View file @
3378890d
...
...
@@ -19,6 +19,7 @@
*/
#include "kdeapplicationlistwidgettest.h"
#include "../src/kdeapplicationlistwidget.h"
#include <qtest.h>
KDeApplicationListWidgetTest
::
KDeApplicationListWidgetTest
(
QObject
*
parent
)
...
...
@@ -32,4 +33,10 @@ KDeApplicationListWidgetTest::~KDeApplicationListWidgetTest()
}
void
KDeApplicationListWidgetTest
::
shouldHaveDefaultValue
()
{
KDeApplicationListWidget
widgetList
;
QCOMPARE
(
widgetList
.
count
(),
0
);
}
QTEST_MAIN
(
KDeApplicationListWidgetTest
)
autotests/kdeapplicationlistwidgettest.h
View file @
3378890d
...
...
@@ -29,6 +29,8 @@ class KDeApplicationListWidgetTest : public QObject
public:
explicit
KDeApplicationListWidgetTest
(
QObject
*
parent
=
0
);
~
KDeApplicationListWidgetTest
();
private
Q_SLOTS
:
void
shouldHaveDefaultValue
();
};
#endif // KDEAPPLICATIONLISTWIDGETTEST_H
src/CMakeLists.txt
View file @
3378890d
...
...
@@ -7,7 +7,7 @@ set(kdebugsettings_SRCS
add_executable
(
kdebugsettings
${
kdebugsettings_SRCS
}
)
target_link_libraries
(
kdebugsettings Qt5::Widgets KF5::I18n KF5::DBusAddons KF5::CoreAddons
)
target_link_libraries
(
kdebugsettings Qt5::Widgets KF5::I18n KF5::DBusAddons KF5::CoreAddons
KF5::ConfigCore
)
install
(
TARGETS kdebugsettings
${
INSTALL_TARGETS_DEFAULT_ARGS
}
)
...
...
src/kdeapplicationdebugsettingpage.cpp
View file @
3378890d
...
...
@@ -21,6 +21,7 @@
#include "kdeapplicationdebugsettingpage.h"
#include <KLocalizedString>
#include <QListWidget>
#include <QPushButton>
#include <QVBoxLayout>
KDeApplicationDebugSettingPage
::
KDeApplicationDebugSettingPage
(
QWidget
*
parent
)
...
...
@@ -33,6 +34,18 @@ KDeApplicationDebugSettingPage::KDeApplicationDebugSettingPage(QWidget *parent)
mListWidget
->
setObjectName
(
QStringLiteral
(
"listwidget"
));
mainLayout
->
addWidget
(
mListWidget
);
QHBoxLayout
*
buttonLayout
=
new
QHBoxLayout
;
mainLayout
->
addLayout
(
buttonLayout
);
mSelectAll
=
new
QPushButton
(
i18n
(
"Select All"
));
mSelectAll
->
setObjectName
(
QStringLiteral
(
"selectall"
));
buttonLayout
->
addWidget
(
mSelectAll
);
connect
(
mSelectAll
,
&
QAbstractButton
::
clicked
,
this
,
&
KDeApplicationDebugSettingPage
::
slotSelectAll
);
mDeselectAll
=
new
QPushButton
(
i18n
(
"Deselect All"
));
mDeselectAll
->
setObjectName
(
QStringLiteral
(
"deselectall"
));
buttonLayout
->
addWidget
(
mDeselectAll
);
connect
(
mSelectAll
,
&
QAbstractButton
::
clicked
,
this
,
&
KDeApplicationDebugSettingPage
::
slotDeselectAll
);
}
KDeApplicationDebugSettingPage
::~
KDeApplicationDebugSettingPage
()
...
...
@@ -40,3 +53,12 @@ KDeApplicationDebugSettingPage::~KDeApplicationDebugSettingPage()
}
void
KDeApplicationDebugSettingPage
::
slotSelectAll
()
{
}
void
KDeApplicationDebugSettingPage
::
slotDeselectAll
()
{
}
src/kdeapplicationdebugsettingpage.h
View file @
3378890d
...
...
@@ -23,14 +23,20 @@
#include <QWidget>
class
QListWidget
;
class
QPushButton
;
class
KDeApplicationDebugSettingPage
:
public
QWidget
{
Q_OBJECT
public:
explicit
KDeApplicationDebugSettingPage
(
QWidget
*
parent
=
Q_NULLPTR
);
~
KDeApplicationDebugSettingPage
();
private
slots
:
void
slotSelectAll
();
void
slotDeselectAll
();
private:
QListWidget
*
mListWidget
;
QPushButton
*
mSelectAll
;
QPushButton
*
mDeselectAll
;
};
#endif // KDEAPPLICATIONDEBUGSETTINGPAGE_H
src/kdebugsettingsdialog.cpp
View file @
3378890d
...
...
@@ -21,6 +21,8 @@
#include "kdebugsettingsdialog.h"
#include <KLocalizedString>
#include <KConfigGroup>
#include <KSharedConfig>
#include <QDialogButtonBox>
#include <QTabWidget>
...
...
@@ -41,10 +43,27 @@ KDebugSettingsDialog::KDebugSettingsDialog(QWidget *parent)
connect
(
buttonBox
,
&
QDialogButtonBox
::
accepted
,
this
,
&
QDialog
::
accept
);
connect
(
buttonBox
,
&
QDialogButtonBox
::
rejected
,
this
,
&
QDialog
::
reject
);
mainLayout
->
addWidget
(
buttonBox
);
readConfig
();
}
KDebugSettingsDialog
::~
KDebugSettingsDialog
()
{
saveConfig
();
}
void
KDebugSettingsDialog
::
readConfig
()
{
KConfigGroup
group
(
KSharedConfig
::
openConfig
(),
"KDebugSettingsDialog"
);
const
QSize
size
=
group
.
readEntry
(
"Size"
,
QSize
(
600
,
400
));
if
(
size
.
isValid
())
{
resize
(
size
);
}
}
void
KDebugSettingsDialog
::
saveConfig
()
{
KConfigGroup
group
(
KSharedConfig
::
openConfig
(),
"KDebugSettingsDialog"
);
group
.
writeEntry
(
"Size"
,
size
());
group
.
sync
();
}
src/kdebugsettingsdialog.h
View file @
3378890d
...
...
@@ -31,6 +31,8 @@ public:
explicit
KDebugSettingsDialog
(
QWidget
*
parent
=
Q_NULLPTR
);
~
KDebugSettingsDialog
();
private:
void
saveConfig
();
void
readConfig
();
QTabWidget
*
mTabWidget
;
};
...
...
src/kdebugsettingsutil.cpp
0 → 100644
View file @
3378890d
/*
Copyright (c) 2015 Montel Laurent <montel@kde.org>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#include "kdebugsettingsutil.h"
void
KDebugSettingsUtil
::
readLoggingCategories
(
const
QString
&
filename
)
{
//TODO
}
src/kdebugsettingsutil.h
0 → 100644
View file @
3378890d
/*
Copyright (c) 2015 Montel Laurent <montel@kde.org>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#ifndef KDEBUGSETTINGSUTIL_H
#define KDEBUGSETTINGSUTIL_H
#include <QString>
namespace
KDebugSettingsUtil
{
void
readLoggingCategories
(
const
QString
&
filename
);
}
#endif // KDEBUGSETTINGSUTIL_H
Write
Preview
Markdown
is supported
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