Commit cfc8ce8c authored by hjk's avatar hjk

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
......@@ -237,17 +237,5 @@ bool GitoriousRepositoryWizardPage::isComplete() const
return m_valid;
}
void GitoriousRepositoryWizardPage::changeEvent(QEvent *e)
{
QWizardPage::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
} // namespace Internal
} // namespace Gitorious
......@@ -51,8 +51,10 @@ namespace Ui {
// A wizard page listing Gitorious repositories in a tree, by repository type.
class GitoriousRepositoryWizardPage : public QWizardPage {
class GitoriousRepositoryWizardPage : public QWizardPage
{
Q_OBJECT
public:
explicit GitoriousRepositoryWizardPage(const GitoriousProjectWizardPage *projectPage,
QWidget *parent = 0);
......@@ -67,9 +69,6 @@ public:
public slots:
void slotCurrentChanged(const QModelIndex &current, const QModelIndex &previous);
protected:
void changeEvent(QEvent *e);
private:
// return the repository (column 0) item.
QStandardItem *currentItem0() const;
......
......@@ -198,17 +198,5 @@ void RemoteDialog::updateButtonState()
m_ui->removeButton->setEnabled(haveSelection);
}
void RemoteDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
m_ui->retranslateUi(this);
break;
default:
break;
}
}
} // namespace Internal
} // namespace Git
......@@ -68,7 +68,8 @@ private:
// RemoteDialog:
// --------------------------------------------------------------------------
class RemoteDialog : public QDialog {
class RemoteDialog : public QDialog
{
Q_OBJECT
public:
......@@ -86,11 +87,6 @@ public slots:
void updateButtonState();
private slots:
protected:
void changeEvent(QEvent *e);
private:
Ui::RemoteDialog *m_ui;
......
......@@ -150,18 +150,6 @@ StashDialog::~StashDialog()
delete ui;
}
void StashDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
QString StashDialog::msgRepositoryLabel(const QString &repository)
{
return repository.isEmpty() ?
......
......@@ -51,8 +51,10 @@ class StashModel;
* (in case restore fails due to conflicts) on current and
* delete on selection/all. */
class StashDialog : public QDialog {
class StashDialog : public QDialog
{
Q_OBJECT
public:
explicit StashDialog(QWidget *parent = 0);
~StashDialog();
......@@ -62,9 +64,6 @@ public:
public slots:
void refresh(const QString &repository, bool force);
protected:
void changeEvent(QEvent *e);
private slots:
void deleteAll();
void deleteSelection();
......
......@@ -43,18 +43,6 @@ RevertDialog::~RevertDialog()
delete m_ui;
}
void RevertDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
m_ui->retranslateUi(this);
break;
default:
break;
}
}
QString RevertDialog::revision() const
{
return m_ui->revisionLineEdit->text();
......
......@@ -47,9 +47,6 @@ public:
QString revision() const;
protected:
void changeEvent(QEvent *e);
private:
Ui::RevertDialog *m_ui;
};
......
......@@ -59,15 +59,3 @@ QString SrcDestDialog::getRepositoryString() const
return m_ui->localPathChooser->path();
return m_ui->urlLineEdit->text();
}
void SrcDestDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
m_ui->retranslateUi(this);
break;
default:
break;
}
}
......@@ -45,12 +45,10 @@ class SrcDestDialog : public QDialog
public:
SrcDestDialog(QWidget *parent = 0);
~SrcDestDialog();
void setPathChooserKind(Utils::PathChooser::Kind kind);
QString getRepositoryString() const;
protected:
void changeEvent(QEvent *e);
private:
Ui::SrcDestDialog *m_ui;
};
......
......@@ -503,18 +503,6 @@ void DoubleTabWidget::paintEvent(QPaintEvent *event)
}
}
void DoubleTabWidget::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
bool DoubleTabWidget::event(QEvent *event)
{
if (event->type() == QEvent::ToolTip) {
......
......@@ -67,7 +67,6 @@ signals:
protected:
void paintEvent(QPaintEvent *event);
void mousePressEvent(QMouseEvent *event);
void changeEvent(QEvent *e);
bool event(QEvent *event);
QSize minimumSizeHint() const;
......
......@@ -127,18 +127,6 @@ void ProjectWizardPage::setVersionControlIndex(int idx)
m_ui->addToVersionControlComboBox->setCurrentIndex(idx);
}
void ProjectWizardPage::changeEvent(QEvent *e)
{
QWizardPage::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
m_ui->retranslateUi(this);
break;
default:
break;
}
}
// Alphabetically, and files in sub-directories first
static bool generatedFilePathLessThan(const QString &filePath1, const QString &filePath2)
{
......
......@@ -69,15 +69,12 @@ public:
void setProjectComoBoxVisible(bool visible);
protected:
virtual void changeEvent(QEvent *e);
private slots:
void slotProjectChanged(int);
void slotManageVcs();
private:
inline void setProjectToolTip(const QString &);
void setProjectToolTip(const QString &);
Ui::WizardPage *m_ui;
QStringList m_projectToolTips;
......
......@@ -147,15 +147,3 @@ int TargetSettingsWidget::currentSubIndex() const
{
return m_targetSelector->currentSubIndex();
}
void TargetSettingsWidget::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
......@@ -49,6 +49,7 @@ namespace Ui {
class TargetSettingsWidget : public QWidget
{
Q_OBJECT
public:
explicit TargetSettingsWidget(QWidget *parent = 0);
~TargetSettingsWidget();
......@@ -77,9 +78,6 @@ signals:
void toolTipRequested(const QPoint &globalPosition, int targetIndex);
void menuShown(int targetIndex);
protected:
void changeEvent(QEvent *e);
private:
Ui::TargetSettingsWidget *ui;
......
......@@ -138,17 +138,5 @@ bool CustomWidgetPluginWizardPage::isComplete() const
return m_complete;
}
void CustomWidgetPluginWizardPage::changeEvent(QEvent *e)
{
QWizardPage::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
m_ui->retranslateUi(this);
break;
default:
break;
}
}
} // namespace Internal