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

Rename class

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