Commit cfc8ce8c authored by hjk's avatar hjk
Browse files

Remove changeEvent(QEvent::LanguageChange) implementation



This was implemented only for a small set of widgets. It's unlikely that
we will ever have or even want a dynamic language selection, until then
this code is only dead freight.

Change-Id: I1bff4e1e89057786c0e5cb57225a508c5d390d9c
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 4e75fc8c
......@@ -398,24 +398,11 @@ void ContextPaneTextWidget::onVerticalAlignmentChanged()
}
}
ContextPaneTextWidget::~ContextPaneTextWidget()
{
delete ui;
}
void ContextPaneTextWidget::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
void ContextPaneTextWidget::timerEvent(QTimerEvent *event)
{
if (event->timerId() == m_fontSizeTimer) {
......
......@@ -82,7 +82,6 @@ signals:
void removeAndChangeProperty(const QString &, const QString &, const QVariant &, bool removeFirst);
protected:
void changeEvent(QEvent *e);
void timerEvent(QTimerEvent *event);
private:
......
......@@ -271,18 +271,6 @@ void ContextPaneWidgetRectangle::timerEvent(QTimerEvent *event)
}
}
void ContextPaneWidgetRectangle::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
void ContextPaneWidgetRectangle::setColor()
{
QLinearGradient gradient;
......
......@@ -74,7 +74,6 @@ signals:
void removeAndChangeProperty(const QString &, const QString &, const QVariant &, bool removeFirst);
protected:
void changeEvent(QEvent *e);
void timerEvent(QTimerEvent *event);
private:
......
......@@ -207,18 +207,6 @@ void EasingContextPane::setProperties(QmlJS::PropertyReader *propertyReader)
ui->durationSpinBox->setValue(250);
}
void EasingContextPane::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
void EasingContextPane::setGraphDisplayMode(GraphDisplayMode newMode)
{
m_displayMode = newMode;
......
......@@ -69,8 +69,6 @@ signals:
void removeAndChangeProperty(const QString &, const QString &, const QVariant &, bool);
protected:
void changeEvent(QEvent *e);
void setOthers();
void setLinear();
void setBack();
......@@ -84,7 +82,6 @@ private:
EasingSimulation *m_simulation;
private slots:
void on_playButton_clicked();
void on_overshootSpinBox_valueChanged(double );
void on_periodSpinBox_valueChanged(double );
......
......@@ -92,18 +92,6 @@ void FileWizardPage::setFileName(const QString &name)
d->m_ui.nameLineEdit->setText(name);
}
void FileWizardPage::changeEvent(QEvent *e)
{
QWizardPage::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
d->m_ui.retranslateUi(this);
break;
default:
break;
}
}
bool FileWizardPage::isComplete() const
{
return d->m_complete;
......
......@@ -74,9 +74,6 @@ private slots:
void slotValidChanged();
void slotActivated();
protected:
virtual void changeEvent(QEvent *e);
private:
FileWizardPagePrivate *d;
};
......
......@@ -138,18 +138,6 @@ void ProjectIntroPage::setDescription(const QString &description)
d->m_ui.descriptionLabel->setText(description);
}
void ProjectIntroPage::changeEvent(QEvent *e)
{
QWizardPage::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
d->m_ui.retranslateUi(this);
break;
default:
break;
}
}
bool ProjectIntroPage::isComplete() const
{
return d->m_complete;
......
......@@ -80,9 +80,6 @@ private slots:
void slotChanged();
void slotActivated();
protected:
virtual void changeEvent(QEvent *e);
private:
enum StatusLabelMode { Error, Warning, Hint };
......
......@@ -45,18 +45,6 @@ MimeTypeMagicDialog::MimeTypeMagicDialog(QWidget *parent) :
connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(validateAccept()));
}
void MimeTypeMagicDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui.retranslateUi(this);
break;
default:
break;
}
}
void MimeTypeMagicDialog::applyRecommended(bool checked)
{
if (checked) {
......
......@@ -62,9 +62,6 @@ public:
void setMagicData(const MagicData &data);
MagicData magicData() const;
protected:
void changeEvent(QEvent *e);
private slots:
void applyRecommended(bool checked);
void validateAccept();
......
......@@ -59,15 +59,3 @@ bool RemoveFileDialog::isDeleteFileChecked() const
{
return m_ui->deleteFileCheckBox->isChecked();
}
void RemoveFileDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
m_ui->retranslateUi(this);
break;
default:
break;
}
}
......@@ -51,9 +51,6 @@ public:
void setDeleteFileVisible(bool visible);
bool isDeleteFileChecked() const;
protected:
virtual void changeEvent(QEvent *e);
private:
Ui::RemoveFileDialog *m_ui;
};
......
......@@ -312,18 +312,6 @@ void BranchDialog::rebase()
stashGuard.preventPop();
}
void BranchDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
m_ui->retranslateUi(this);
break;
default:
break;
}
}
QModelIndex BranchDialog::selectedIndex()
{
QModelIndexList selected = m_ui->branchView->selectionModel()->selectedIndexes();
......
......@@ -33,7 +33,6 @@
#include <QDialog>
QT_BEGIN_NAMESPACE
class QPushButton;
class QModelIndex;
QT_END_NAMESPACE
......@@ -52,7 +51,8 @@ class BranchModel;
* branches below. Offers to checkout/delete local branches.
*
*/
class BranchDialog : public QDialog {
class BranchDialog : public QDialog
{
Q_OBJECT
public:
......@@ -74,16 +74,11 @@ private slots:
void merge();
void rebase();
protected:
void changeEvent(QEvent *e);
private:
QModelIndex selectedIndex();
Ui::BranchDialog *m_ui;
BranchModel *m_model;
QString m_repository;
};
......
......@@ -297,17 +297,5 @@ void GitoriousHostWidget::slotError(const QString &e)
m_errorClearTimer->start();
}
void GitoriousHostWidget::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
} // namespace Internal
} // namespace Gitorious
......@@ -54,8 +54,10 @@ namespace Ui {
* it receives the projects. As soon as there are projects, isValid() becomes
* true. */
class GitoriousHostWidget : public QWidget {
class GitoriousHostWidget : public QWidget
{
Q_OBJECT
public:
GitoriousHostWidget(QWidget *parent = 0);
~GitoriousHostWidget();
......@@ -72,9 +74,6 @@ signals:
public slots:
void selectRow(int);
protected:
void changeEvent(QEvent *e);
private slots:
void slotBrowse();
void slotDelete();
......
......@@ -281,17 +281,5 @@ QSharedPointer<GitoriousProject> GitoriousProjectWidget::project() const
return QSharedPointer<GitoriousProject>(new GitoriousProject);
}
void GitoriousProjectWidget::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
} // namespace Internal
} // namespace Gitorious
......@@ -56,8 +56,10 @@ namespace Ui {
* it receives the projects. isValid() and signal validChanged are
* provided for use in a QWizardPage. Host matching happens via name as the
* hostIndex might change due to deleting hosts. */
class GitoriousProjectWidget : public QWidget {
class GitoriousProjectWidget : public QWidget
{
Q_OBJECT
public:
explicit GitoriousProjectWidget(int hostIndex,
QWidget *parent = 0);
......@@ -91,9 +93,6 @@ private slots:
void slotUpdateProjects(int hostIndex);
void slotUpdateCheckBoxChanged(int);
protected:
void changeEvent(QEvent *e);
private:
QStandardItem *itemFromIndex(const QModelIndex &idx) const;
QStandardItem *currentItem() const;
......@@ -107,7 +106,7 @@ private:
bool m_valid;
};
} // namespace Internal
} // namespace Gitorious
#endif // GITORIOUSPROJECTWIDGET_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