Commit a797edae authored by Laurent Montel's avatar Laurent Montel 😁

Rename class

parent 81721a45
...@@ -93,7 +93,7 @@ set(libmailcommon_collection_SRCS ...@@ -93,7 +93,7 @@ set(libmailcommon_collection_SRCS
collectionpage/collectionexpirypage.cpp collectionpage/collectionexpirypage.cpp
collectionpage/expirecollectionattribute.cpp collectionpage/expirecollectionattribute.cpp
collectionpage/newmailnotifierattribute.cpp collectionpage/newmailnotifierattribute.cpp
collectionpage/contentstypecombobox.cpp collectionpage/incidencesforwidget.cpp
) )
set(libmailcommon_folder_SRCS set(libmailcommon_folder_SRCS
......
...@@ -13,7 +13,7 @@ set( mailcommon_expirecollectionattributetest_source expirecollectionattributete ...@@ -13,7 +13,7 @@ set( mailcommon_expirecollectionattributetest_source expirecollectionattributete
kde4_add_unit_test( expirecollectionattributetest ${mailcommon_expirecollectionattributetest_source}) kde4_add_unit_test( expirecollectionattributetest ${mailcommon_expirecollectionattributetest_source})
target_link_libraries( expirecollectionattributetest ${QT_QTTEST_LIBRARY} ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY} ${KDEPIMLIBS_AKONADI_LIBS}) target_link_libraries( expirecollectionattributetest ${QT_QTTEST_LIBRARY} ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY} ${KDEPIMLIBS_AKONADI_LIBS})
set( mailcommon_contentstypecomboboxtest_source contentstypecomboboxtest.cpp ) set( mailcommon_incidencesforwidgettest_source incidencesforwidgettest.cpp )
kde4_add_unit_test( contentstypecomboboxtest ${mailcommon_contentstypecomboboxtest_source}) kde4_add_unit_test( incidencesforwidgettest ${mailcommon_incidencesforwidgettest_source})
target_link_libraries( contentstypecomboboxtest ${QT_QTTEST_LIBRARY} ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY} mailcommon) target_link_libraries( incidencesforwidgettest ${QT_QTTEST_LIBRARY} ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY} mailcommon)
...@@ -18,27 +18,27 @@ ...@@ -18,27 +18,27 @@
*/ */
#include "contentstypecomboboxtest.h" #include "incidencesforwidgettest.h"
#include "../contentstypecombobox.h" #include "../incidencesforwidget.h"
#include <kcombobox.h> #include <kcombobox.h>
#include <qlabel.h> #include <qlabel.h>
#include <qtest_kde.h> #include <qtest_kde.h>
#include <QSignalSpy> #include <QSignalSpy>
ContentsTypeComboBoxTest::ContentsTypeComboBoxTest(QObject *parent) IncidencesForWidgetTest::IncidencesForWidgetTest(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
} }
ContentsTypeComboBoxTest::~ContentsTypeComboBoxTest() IncidencesForWidgetTest::~IncidencesForWidgetTest()
{ {
} }
void ContentsTypeComboBoxTest::shouldHaveDefaultValue() void IncidencesForWidgetTest::shouldHaveDefaultValue()
{ {
MailCommon::ContentsTypeComboBox contentType; MailCommon::IncidencesForWidget contentType;
QLabel *label = qFindChild<QLabel *>(&contentType, QLatin1String("contentstypelabel")); QLabel *label = qFindChild<QLabel *>(&contentType, QLatin1String("contentstypelabel"));
QVERIFY(label); QVERIFY(label);
KComboBox *combo = qFindChild<KComboBox *>(&contentType, QLatin1String("contentstypecombobox")); KComboBox *combo = qFindChild<KComboBox *>(&contentType, QLatin1String("contentstypecombobox"));
...@@ -47,9 +47,9 @@ void ContentsTypeComboBoxTest::shouldHaveDefaultValue() ...@@ -47,9 +47,9 @@ void ContentsTypeComboBoxTest::shouldHaveDefaultValue()
QCOMPARE(contentType.currentIndex(), 0); QCOMPARE(contentType.currentIndex(), 0);
} }
void ContentsTypeComboBoxTest::shouldChangeComboBoxIndex() void IncidencesForWidgetTest::shouldChangeComboBoxIndex()
{ {
MailCommon::ContentsTypeComboBox contentType; MailCommon::IncidencesForWidget contentType;
KComboBox *combo = qFindChild<KComboBox *>(&contentType, QLatin1String("contentstypecombobox")); KComboBox *combo = qFindChild<KComboBox *>(&contentType, QLatin1String("contentstypecombobox"));
for (int i = 0 ; i < combo->count() ; ++i) { for (int i = 0 ; i < combo->count() ; ++i) {
contentType.setCurrentIndex(i); contentType.setCurrentIndex(i);
...@@ -58,9 +58,9 @@ void ContentsTypeComboBoxTest::shouldChangeComboBoxIndex() ...@@ -58,9 +58,9 @@ void ContentsTypeComboBoxTest::shouldChangeComboBoxIndex()
} }
} }
void ContentsTypeComboBoxTest::shouldEmitSignalWhenIndexChanged() void IncidencesForWidgetTest::shouldEmitSignalWhenIndexChanged()
{ {
MailCommon::ContentsTypeComboBox contentType; MailCommon::IncidencesForWidget contentType;
contentType.show(); contentType.show();
QTest::qWaitForWindowShown(&contentType); QTest::qWaitForWindowShown(&contentType);
QSignalSpy spy(&contentType, SIGNAL(indexChanged(int))); QSignalSpy spy(&contentType, SIGNAL(indexChanged(int)));
...@@ -68,4 +68,4 @@ void ContentsTypeComboBoxTest::shouldEmitSignalWhenIndexChanged() ...@@ -68,4 +68,4 @@ void ContentsTypeComboBoxTest::shouldEmitSignalWhenIndexChanged()
QCOMPARE(spy.at(0).count(), 1); QCOMPARE(spy.at(0).count(), 1);
} }
QTEST_KDEMAIN(ContentsTypeComboBoxTest, GUI) QTEST_KDEMAIN(IncidencesForWidgetTest, GUI)
...@@ -17,21 +17,21 @@ ...@@ -17,21 +17,21 @@
02110-1301, USA. 02110-1301, USA.
*/ */
#ifndef CONTENTSTYPECOMBOBOXTEST_H #ifndef INCIDENCESFORWIDGETTEST_H
#define CONTENTSTYPECOMBOBOXTEST_H #define INCIDENCESFORWIDGETTEST_H
#include <QObject> #include <QObject>
class ContentsTypeComboBoxTest : public QObject class IncidencesForWidgetTest : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ContentsTypeComboBoxTest(QObject *parent = 0); explicit IncidencesForWidgetTest(QObject *parent = 0);
~ContentsTypeComboBoxTest(); ~IncidencesForWidgetTest();
private Q_SLOTS: private Q_SLOTS:
void shouldHaveDefaultValue(); void shouldHaveDefaultValue();
void shouldChangeComboBoxIndex(); void shouldChangeComboBoxIndex();
void shouldEmitSignalWhenIndexChanged(); void shouldEmitSignalWhenIndexChanged();
}; };
#endif // CONTENTSTYPECOMBOBOXTEST_H #endif // INCIDENCESFORWIDGETTEST_H
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "collectiongeneralpage.h" #include "collectiongeneralpage.h"
#include "collectiontypeutil.h" #include "collectiontypeutil.h"
#include "contentstypecombobox.h" #include "incidencesforwidget.h"
#include "collectionannotationsattribute.h" #include "collectionannotationsattribute.h"
#include "newmailnotifierattribute.h" #include "newmailnotifierattribute.h"
#include "foldercollection.h" #include "foldercollection.h"
...@@ -234,7 +234,7 @@ void CollectionGeneralPage::init( const Akonadi::Collection &collection ) ...@@ -234,7 +234,7 @@ void CollectionGeneralPage::init( const Akonadi::Collection &collection )
// or if it's set to calendar or task (existing folder) // or if it's set to calendar or task (existing folder)
const bool folderTypeComboboxEnabled = ( folderType == CollectionTypeUtil::ContentsTypeCalendar || folderType == CollectionTypeUtil::ContentsTypeTask ); const bool folderTypeComboboxEnabled = ( folderType == CollectionTypeUtil::ContentsTypeCalendar || folderType == CollectionTypeUtil::ContentsTypeTask );
++row; ++row;
mIncidencesForComboBox = new ContentsTypeComboBox(this); mIncidencesForComboBox = new IncidencesForWidget(this);
gl->addWidget(mIncidencesForComboBox, row, 0, 1, 1); gl->addWidget(mIncidencesForComboBox, row, 0, 1, 1);
mIncidencesForComboBox->setCurrentIndex( incidencesFor ); mIncidencesForComboBox->setCurrentIndex( incidencesFor );
......
...@@ -36,7 +36,7 @@ class IdentityCombo; ...@@ -36,7 +36,7 @@ class IdentityCombo;
namespace MailCommon { namespace MailCommon {
class FolderCollection; class FolderCollection;
class ContentsTypeComboBox; class IncidencesForWidget;
class MAILCOMMON_EXPORT CollectionGeneralPage : public Akonadi::CollectionPropertiesPage class MAILCOMMON_EXPORT CollectionGeneralPage : public Akonadi::CollectionPropertiesPage
{ {
Q_OBJECT Q_OBJECT
...@@ -59,7 +59,7 @@ private Q_SLOTS: ...@@ -59,7 +59,7 @@ private Q_SLOTS:
private: private:
QString mColorName; QString mColorName;
KComboBox *mContentsComboBox; KComboBox *mContentsComboBox;
ContentsTypeComboBox *mIncidencesForComboBox; IncidencesForWidget *mIncidencesForComboBox;
QCheckBox *mSharedSeenFlagsCheckBox; QCheckBox *mSharedSeenFlagsCheckBox;
QCheckBox *mNotifyOnNewMailCheckBox; QCheckBox *mNotifyOnNewMailCheckBox;
QCheckBox *mKeepRepliesInSameFolderCheckBox; QCheckBox *mKeepRepliesInSameFolderCheckBox;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
#include "contentstypecombobox.h" #include "incidencesforwidget.h"
#include <QLabel> #include <QLabel>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <KLocalizedString> #include <KLocalizedString>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
using namespace MailCommon; using namespace MailCommon;
ContentsTypeComboBox::ContentsTypeComboBox(QWidget *parent) IncidencesForWidget::IncidencesForWidget(QWidget *parent)
: QWidget(parent) : QWidget(parent)
{ {
QHBoxLayout *hbox = new QHBoxLayout(this); QHBoxLayout *hbox = new QHBoxLayout(this);
...@@ -61,17 +61,17 @@ ContentsTypeComboBox::ContentsTypeComboBox(QWidget *parent) ...@@ -61,17 +61,17 @@ ContentsTypeComboBox::ContentsTypeComboBox(QWidget *parent)
connect(mIncidencesForComboBox, SIGNAL(currentIndexChanged(int)), SIGNAL(indexChanged(int))); connect(mIncidencesForComboBox, SIGNAL(currentIndexChanged(int)), SIGNAL(indexChanged(int)));
} }
ContentsTypeComboBox::~ContentsTypeComboBox() IncidencesForWidget::~IncidencesForWidget()
{ {
} }
int ContentsTypeComboBox::currentIndex() const int IncidencesForWidget::currentIndex() const
{ {
return mIncidencesForComboBox->currentIndex(); return mIncidencesForComboBox->currentIndex();
} }
void ContentsTypeComboBox::setCurrentIndex(int index) void IncidencesForWidget::setCurrentIndex(int index)
{ {
mIncidencesForComboBox->setCurrentIndex(index); mIncidencesForComboBox->setCurrentIndex(index);
} }
......
...@@ -18,20 +18,20 @@ ...@@ -18,20 +18,20 @@
*/ */
#ifndef CONTENTSTYPECOMBOBOX_H #ifndef INCIDENCESFORWIDGET_H
#define CONTENTSTYPECOMBOBOX_H #define INCIDENCESFORWIDGET_H
#include "mailcommon_export.h" #include "mailcommon_export.h"
#include <QWidget> #include <QWidget>
class KComboBox; class KComboBox;
namespace MailCommon { namespace MailCommon {
class MAILCOMMON_EXPORT ContentsTypeComboBox : public QWidget class MAILCOMMON_EXPORT IncidencesForWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ContentsTypeComboBox(QWidget *parent=0); explicit IncidencesForWidget(QWidget *parent=0);
~ContentsTypeComboBox(); ~IncidencesForWidget();
int currentIndex() const; int currentIndex() const;
void setCurrentIndex(int index); void setCurrentIndex(int index);
...@@ -44,4 +44,4 @@ private: ...@@ -44,4 +44,4 @@ private:
}; };
} }
#endif // CONTENTSTYPECOMBOBOX_H #endif // INCIDENCESFORWIDGET_H
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