Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Unmaintained
KDE Pim
Commits
d142a19c
Commit
d142a19c
authored
Nov 28, 2014
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix enable/disable ok button . Add unittest here
parent
2ebf5587
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
109 additions
and
1 deletion
+109
-1
sieveeditor/CMakeLists.txt
sieveeditor/CMakeLists.txt
+2
-0
sieveeditor/autotests/CMakeLists.txt
sieveeditor/autotests/CMakeLists.txt
+9
-0
sieveeditor/autotests/serversievesettingstest.cpp
sieveeditor/autotests/serversievesettingstest.cpp
+57
-0
sieveeditor/autotests/serversievesettingstest.h
sieveeditor/autotests/serversievesettingstest.h
+40
-0
sieveeditor/serversievesettings.cpp
sieveeditor/serversievesettings.cpp
+1
-1
No files found.
sieveeditor/CMakeLists.txt
View file @
d142a19c
...
...
@@ -58,3 +58,5 @@ install(FILES
DESTINATION
${
DATA_INSTALL_DIR
}
/sieveeditor
)
install
(
PROGRAMS sieveeditor.desktop DESTINATION
${
XDG_APPS_INSTALL_DIR
}
)
add_subdirectory
(
autotests
)
sieveeditor/autotests/CMakeLists.txt
0 → 100644
View file @
d142a19c
set
(
sieveedit_serversievesettings_source serversievesettingstest.cpp ../serversievesettings.cpp
)
kde4_add_ui_files
(
sieveedit_serversievesettings_source
../ui/serversievesettings.ui
)
kde4_add_unit_test
(
serversievesettingstest
${
sieveedit_serversievesettings_source
}
)
target_link_libraries
(
serversievesettingstest
${
QT_QTTEST_LIBRARY
}
${
KDE4_KDEUI_LIBS
}
)
sieveeditor/autotests/serversievesettingstest.cpp
0 → 100644
View file @
d142a19c
/*
Copyright (c) 2014 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 "serversievesettingstest.h"
#include "../serversievesettings.h"
#include <qtest_kde.h>
ServerSieveSettingsTest
::
ServerSieveSettingsTest
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
ServerSieveSettingsTest
::~
ServerSieveSettingsTest
()
{
}
void
ServerSieveSettingsTest
::
shouldHaveDefaultValue
()
{
ServerSieveSettings
widget
;
QVERIFY
(
widget
.
serverName
().
isEmpty
());
QVERIFY
(
widget
.
userName
().
isEmpty
());
QVERIFY
(
widget
.
password
().
isEmpty
());
}
void
ServerSieveSettingsTest
::
shouldSetValue
()
{
const
QString
password
=
QLatin1String
(
"password"
);
const
QString
username
=
QLatin1String
(
"username"
);
const
QString
servername
=
QLatin1String
(
"servername"
);
ServerSieveSettings
widget
;
widget
.
setServerName
(
servername
);
widget
.
setUserName
(
username
);
widget
.
setPassword
(
password
);
QCOMPARE
(
widget
.
serverName
(),
servername
);
QCOMPARE
(
widget
.
userName
(),
username
);
QCOMPARE
(
widget
.
password
(),
password
);
}
QTEST_KDEMAIN
(
ServerSieveSettingsTest
,
GUI
)
sieveeditor/autotests/serversievesettingstest.h
0 → 100644
View file @
d142a19c
/*
Copyright (c) 2014 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 SERVERSIEVESETTINGSTEST_H
#define SERVERSIEVESETTINGSTEST_H
#include <QObject>
class
ServerSieveSettingsTest
:
public
QObject
{
Q_OBJECT
public:
explicit
ServerSieveSettingsTest
(
QObject
*
parent
=
0
);
~
ServerSieveSettingsTest
();
private
Q_SLOTS
:
void
shouldHaveDefaultValue
();
void
shouldSetValue
();
};
#endif // SERVERSIEVESETTINGSTEST_H
sieveeditor/serversievesettings.cpp
View file @
d142a19c
...
...
@@ -107,7 +107,7 @@ void ServerSieveSettings::populateDefaultAuthenticationOptions()
void
ServerSieveSettings
::
slotUserServerNameChanged
()
{
Q_EMIT
enableOkButton
(
!
ui
->
userName
->
text
().
isEmpty
()
&&
!
ui
->
serverName
->
text
().
isEmpty
());
Q_EMIT
enableOkButton
(
!
ui
->
userName
->
text
().
trimmed
().
isEmpty
()
&&
!
ui
->
serverName
->
text
().
trimmed
().
isEmpty
());
}
QString
ServerSieveSettings
::
serverName
()
const
...
...
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