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
5331b09a
Commit
5331b09a
authored
Feb 27, 2015
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
By default debug is enabled. Add more categories. Fix enabled/disable ok
parent
d51181a3
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
81 additions
and
2 deletions
+81
-2
autotests/configurecustomsettingdialogtest.cpp
autotests/configurecustomsettingdialogtest.cpp
+3
-0
autotests/configurecustomsettingwidgettest.cpp
autotests/configurecustomsettingwidgettest.cpp
+19
-0
autotests/configurecustomsettingwidgettest.h
autotests/configurecustomsettingwidgettest.h
+1
-0
data/kde.categories
data/kde.categories
+35
-0
src/configurecustomsettingdialog.cpp
src/configurecustomsettingdialog.cpp
+5
-0
src/configurecustomsettingwidget.cpp
src/configurecustomsettingwidget.cpp
+8
-1
src/configurecustomsettingwidget.h
src/configurecustomsettingwidget.h
+8
-0
src/kdeapplicationlistwidget.cpp
src/kdeapplicationlistwidget.cpp
+1
-0
src/kdebugsettingsdialog.h
src/kdebugsettingsdialog.h
+1
-1
No files found.
autotests/configurecustomsettingdialogtest.cpp
View file @
5331b09a
...
...
@@ -22,6 +22,7 @@
#include "../src/configurecustomsettingdialog.h"
#include "../src/configurecustomsettingwidget.h"
#include <QDialogButtonBox>
#include <QPushButton>
#include <qtest.h>
ConfigureCustomSettingDialogTest
::
ConfigureCustomSettingDialogTest
(
QObject
*
parent
)
:
QObject
(
parent
)
...
...
@@ -39,8 +40,10 @@ void ConfigureCustomSettingDialogTest::shouldHaveDefaultValue()
ConfigureCustomSettingDialog
dlg
;
QDialogButtonBox
*
buttonBox
=
dlg
.
findChild
<
QDialogButtonBox
*>
(
QStringLiteral
(
"buttonbox"
));
QVERIFY
(
buttonBox
);
QVERIFY
(
!
buttonBox
->
button
(
QDialogButtonBox
::
Ok
)
->
isEnabled
());
ConfigureCustomSettingWidget
*
widget
=
dlg
.
findChild
<
ConfigureCustomSettingWidget
*>
(
QStringLiteral
(
"customsettingwidget"
));
QVERIFY
(
widget
);
}
QTEST_MAIN
(
ConfigureCustomSettingDialogTest
)
autotests/configurecustomsettingwidgettest.cpp
View file @
5331b09a
...
...
@@ -23,6 +23,7 @@
#include <QComboBox>
#include <QLabel>
#include <QLineEdit>
#include <QSignalSpy>
#include <qcheckbox.h>
#include <qtest.h>
...
...
@@ -75,4 +76,22 @@ void ConfigureCustomSettingWidgetTest::shouldRestoreRules()
QCOMPARE
(
input
,
w
.
rule
());
}
void
ConfigureCustomSettingWidgetTest
::
shouldEmitSignalWhenWeChangeLogName
()
{
ConfigureCustomSettingWidget
w
;
QLineEdit
*
categoryLineEdit
=
w
.
findChild
<
QLineEdit
*>
(
QStringLiteral
(
"category_lineedit"
));
QVERIFY
(
categoryLineEdit
);
QSignalSpy
spy
(
&
w
,
SIGNAL
(
enableButton
(
bool
)));
categoryLineEdit
->
setText
(
QStringLiteral
(
"bla"
));
QCOMPARE
(
spy
.
count
(),
1
);
QCOMPARE
(
spy
.
at
(
0
).
at
(
0
).
value
<
bool
>
(),
true
);
categoryLineEdit
->
clear
();
QCOMPARE
(
spy
.
count
(),
2
);
QCOMPARE
(
spy
.
at
(
1
).
at
(
0
).
value
<
bool
>
(),
false
);
categoryLineEdit
->
setText
(
QStringLiteral
(
" "
));
QCOMPARE
(
spy
.
count
(),
3
);
QCOMPARE
(
spy
.
at
(
2
).
at
(
0
).
value
<
bool
>
(),
false
);
}
QTEST_MAIN
(
ConfigureCustomSettingWidgetTest
)
autotests/configurecustomsettingwidgettest.h
View file @
5331b09a
...
...
@@ -33,6 +33,7 @@ private Q_SLOTS:
void
shouldHaveDefaultValue
();
void
shouldRestoreRules_data
();
void
shouldRestoreRules
();
void
shouldEmitSignalWhenWeChangeLogName
();
};
#endif // CONFIGURECUSTOMSETTINGWIDGETTEST_H
data/kde.categories
View file @
5331b09a
# Format : logname<space>description
#kdepimlibs
log_kldap kioslave (kldap)
log_sieve kioslave (sieve)
log_smtp kioslave (smtp)
log_pop3 kioslave (pop3)
log_kcalutils kcalutils (pim lib)
log_kimap kimap (pim lib)
log_kidentitymanagement kidentitymanagement (pim lib)
log_kcontacts kcontacts (pim lib)
log_ktnef ktnef (pim lib)
log_mailtransport mailtransport (pim lib)
log_kmbox kmbox (pim lib)
log_kblog kblog (pim lib)
log_kcalcore kcalcore (pim lib)
log_kalarmcal kalarmcal (pim lib)
log_kontactinterface kontactinterface (pim lib)
log_kxmlrpcclient kxmlrpcclient (pim lib)
log_ldap ldap (pim lib)
log_akonadicalendar akonadicalendar (pim lib)
# kdepim
log_sieveeditor kdepim (sieveeditor)
log_ldapclient kdepim (ldapclient)
...
...
@@ -43,3 +63,18 @@ log_messageviewer kdepim (messageviewer)
log_pimsettingexporter kdepim (pimsettingexporter)
log_kaddressbook kdepim (kaddressbook)
log_importwizard kdepim (importwizard)
#kdegames
log_granatier kdegames (granatier)
log_ksirkskineditor kdegames (ksirk)
ksnakeduel_smtp kdegames (ksnakeduel)
log_kgoldrunner kdegames (kgoldrunner)
log_kshisen kdegames (kshisen)
log_libkmahjongg lib kdegames (libkmahjongg)
LOG_KUBRICK kdegames (kubrick)
log_lskat kdegames (lskat)
log_fourinline kdegames (kfourinline)
#kdeedu
log_klettres kdeedu (kletters)
src/configurecustomsettingdialog.cpp
View file @
5331b09a
...
...
@@ -24,6 +24,7 @@
#include <qboxlayout.h>
#include <KLocalizedString>
#include <qdialogbuttonbox.h>
#include <QPushButton>
ConfigureCustomSettingDialog
::
ConfigureCustomSettingDialog
(
QWidget
*
parent
)
:
QDialog
(
parent
)
...
...
@@ -39,7 +40,11 @@ ConfigureCustomSettingDialog::ConfigureCustomSettingDialog(QWidget *parent)
buttonBox
->
setObjectName
(
QStringLiteral
(
"buttonbox"
));
connect
(
buttonBox
,
&
QDialogButtonBox
::
accepted
,
this
,
&
QDialog
::
accept
);
connect
(
buttonBox
,
&
QDialogButtonBox
::
rejected
,
this
,
&
QDialog
::
reject
);
QPushButton
*
buttonOk
=
buttonBox
->
button
(
QDialogButtonBox
::
Ok
);
buttonOk
->
setEnabled
(
false
);
connect
(
mCustomSettingWidget
,
SIGNAL
(
enableButton
(
bool
)),
buttonOk
,
SLOT
(
setEnabled
(
bool
)));
mainLayout
->
addWidget
(
buttonBox
);
}
ConfigureCustomSettingDialog
::~
ConfigureCustomSettingDialog
()
...
...
src/configurecustomsettingwidget.cpp
View file @
5331b09a
...
...
@@ -39,6 +39,7 @@ ConfigureCustomSettingWidget::ConfigureCustomSettingWidget(QWidget *parent)
lab
->
setObjectName
(
QStringLiteral
(
"category_label"
));
mCategoryLineEdit
=
new
QLineEdit
;
mCategoryLineEdit
->
setObjectName
(
QStringLiteral
(
"category_lineedit"
));
connect
(
mCategoryLineEdit
,
SIGNAL
(
textChanged
(
QString
)),
SLOT
(
slotTextChanged
(
QString
)));
QHBoxLayout
*
categoryLayout
=
new
QHBoxLayout
;
vbox
->
addLayout
(
categoryLayout
);
categoryLayout
->
addWidget
(
lab
);
...
...
@@ -69,6 +70,12 @@ ConfigureCustomSettingWidget::~ConfigureCustomSettingWidget()
}
void
ConfigureCustomSettingWidget
::
slotTextChanged
(
const
QString
&
text
)
{
const
bool
state
=
!
text
.
trimmed
().
isEmpty
();
Q_EMIT
enableButton
(
state
);
}
void
ConfigureCustomSettingWidget
::
setRule
(
const
QString
&
rule
)
{
const
Category
cat
=
KDebugSettingsUtil
::
parseLineLoggingQtCategory
(
rule
);
...
...
@@ -90,7 +97,7 @@ void ConfigureCustomSettingWidget::setRule(const QString &rule)
QString
ConfigureCustomSettingWidget
::
rule
()
{
QString
ruleStr
=
mCategoryLineEdit
->
text
();
QString
ruleStr
=
mCategoryLineEdit
->
text
()
.
trimmed
()
;
if
(
!
ruleStr
.
isEmpty
())
{
const
QString
type
=
mCategoryType
->
currentData
().
toString
();
if
(
!
type
.
isEmpty
())
{
...
...
src/configurecustomsettingwidget.h
View file @
5331b09a
...
...
@@ -31,8 +31,16 @@ class ConfigureCustomSettingWidget : public QWidget
public:
explicit
ConfigureCustomSettingWidget
(
QWidget
*
parent
=
Q_NULLPTR
);
~
ConfigureCustomSettingWidget
();
QString
rule
();
void
setRule
(
const
QString
&
rule
);
Q_SIGNALS:
void
enableButton
(
bool
state
);
private
Q_SLOTS
:
void
slotTextChanged
(
const
QString
&
);
private:
QLineEdit
*
mCategoryLineEdit
;
QCheckBox
*
mEnableCategory
;
...
...
src/kdeapplicationlistwidget.cpp
View file @
5331b09a
...
...
@@ -77,6 +77,7 @@ KDeApplicationListWidgetItem::KDeApplicationListWidgetItem(QListWidget *parent)
:
QListWidgetItem
(
parent
)
{
setFlags
(
flags
()
|
Qt
::
ItemIsUserCheckable
);
setCheckState
(
Qt
::
Checked
);
}
KDeApplicationListWidgetItem
::~
KDeApplicationListWidgetItem
()
...
...
src/kdebugsettingsdialog.h
View file @
5331b09a
...
...
@@ -29,7 +29,7 @@ class KDEApplicationDebugSettingPage;
class
CustomDebugSettingsPage
;
struct
Category
{
Category
()
:
enabled
(
fals
e
)
:
enabled
(
tru
e
)
{
}
...
...
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