Commit 39f1ce05 authored by hjk's avatar hjk
Browse files

Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline

parents a8342123 8fd841c1
......@@ -2,7 +2,7 @@ unix {
QDOC = SRCDIR=$$PWD OUTDIR=$$OUT_PWD/doc/html $$(QTDIR)/tools/qdoc3/qdoc3
HELPGENERATOR = $$(QTDIR)/bin/qhelpgenerator
} else {
QDOC = $$(QTDIR)\tools\qdoc3\release\qdoc3.exe
QDOC = set SRCDIR=$$PWD&& set OUTDIR=$$OUT_PWD/doc/html&& $$(QTDIR)\tools\qdoc3\release\qdoc3.exe
HELPGENERATOR = $$(QTDIR)\bin\qhelpgenerator.exe
}
......
......@@ -57,6 +57,7 @@
#include "AST.h"
#include "Literals.h"
#include <cstdlib>
#include <cstring>
#include <cassert>
CPLUSPLUS_BEGIN_NAMESPACE
......
......@@ -425,6 +425,12 @@ bool ResolveExpression::visit(UnaryExpressionAST *ast)
return false;
}
bool ResolveExpression::visit(CompoundLiteralAST *ast)
{
accept(ast->type_id);
return false;
}
bool ResolveExpression::visit(QualifiedNameAST *ast)
{
ResolveClass resolveClass;
......
......@@ -105,6 +105,7 @@ protected:
virtual bool visit(ThrowExpressionAST *ast);
virtual bool visit(TypeIdAST *ast);
virtual bool visit(UnaryExpressionAST *ast);
virtual bool visit(CompoundLiteralAST *ast);
//names
virtual bool visit(QualifiedNameAST *ast);
......
......@@ -54,7 +54,8 @@ public:
virtual QString trCategory() const = 0;
virtual QWidget *createPage(QWidget *parent) = 0;
virtual void finished(bool accepted) = 0;
virtual void apply() = 0;
virtual void finish() = 0;
};
} // namespace Core
......
......@@ -126,20 +126,22 @@ void SettingsDialog::pageSelected(QTreeWidgetItem *)
void SettingsDialog::accept()
{
foreach (IOptionsPage *page, m_pages)
page->finished(true);
foreach (IOptionsPage *page, m_pages) {
page->apply();
page->finish();
}
done(QDialog::Accepted);
}
void SettingsDialog::reject()
{
foreach (IOptionsPage *page, m_pages)
page->finished(false);
page->finish();
done(QDialog::Rejected);
}
void SettingsDialog::apply()
{
foreach (IOptionsPage *page, m_pages)
page->finished(true);
page->apply();
}
......@@ -120,14 +120,14 @@ QWidget *ShortcutSettings::createPage(QWidget *parent)
return w;
}
void ShortcutSettings::finished(bool accepted)
void ShortcutSettings::apply()
{
if (accepted) {
foreach (ShortcutItem *item, m_scitems) {
item->m_cmd->setKeySequence(item->m_key);
}
}
foreach (ShortcutItem *item, m_scitems)
item->m_cmd->setKeySequence(item->m_key);
}
void ShortcutSettings::finish()
{
qDeleteAll(m_scitems);
m_scitems.clear();
}
......
......@@ -77,7 +77,8 @@ public:
QString trCategory() const;
QWidget *createPage(QWidget *parent);
void finished(bool accepted);
void apply();
void finish();
protected:
bool eventFilter(QObject *o, QEvent *e);
......
......@@ -81,11 +81,8 @@ QWidget *GeneralSettings::createPage(QWidget *parent)
return w;
}
void GeneralSettings::finished(bool accepted)
void GeneralSettings::apply()
{
if (!accepted)
return;
// Apply the new base color if accepted
StyleHelper::setBaseColor(m_page->colorButton->color());
EditorManager::instance()->setExternalEditor(m_page->externalEditorEdit->text());
......
......@@ -55,7 +55,8 @@ public:
QString category() const;
QString trCategory() const;
QWidget* createPage(QWidget *parent);
void finished(bool accepted);
void apply();
void finish() { }
private slots:
void resetInterfaceColor();
......
......@@ -86,11 +86,8 @@ QWidget *SettingsPage::createPage(QWidget *parent)
return w;
}
void SettingsPage::finished(bool accepted)
void SettingsPage::apply()
{
if (!accepted)
return;
m_username = m_ui.userEdit->text();
m_server = QUrl(m_ui.serverEdit->text());
m_copy = m_ui.clipboardBox->isChecked();
......
......@@ -59,7 +59,8 @@ public:
QString trCategory() const;
QWidget *createPage(QWidget *parent);
void finished(bool accepted);
void apply();
void finish() { }
QString username() const;
QUrl serverUrl() const;
......
......@@ -78,11 +78,8 @@ QWidget *CompletionSettingsPage::createPage(QWidget *parent)
return w;
}
void CompletionSettingsPage::finished(bool accepted)
void CompletionSettingsPage::apply()
{
if (!accepted)
return;
m_completion->setCaseSensitivity(
m_page->caseSensitive->isChecked() ? Qt::CaseSensitive : Qt::CaseInsensitive);
m_completion->setAutoInsertBraces(m_page->autoInsertBraces->isChecked());
......
......@@ -56,7 +56,8 @@ public:
QString trCategory() const;
QWidget *createPage(QWidget *parent);
void finished(bool accepted);
void apply();
void finish() { }
private:
CppCodeCompletion *m_completion;
......
......@@ -122,11 +122,8 @@ void GdbOptionPage::onScriptFileChanged()
m_settings->m_scriptFile = m_ui.scriptFileChooser->path();
}
void GdbOptionPage::finished(bool accepted)
void GdbOptionPage::apply()
{
if (!accepted)
return;
m_settings->m_gdbCmd = m_ui.gdbLocationChooser->path();
m_settings->m_gdbEnv = m_ui.environmentEdit->text();
m_settings->m_autoRun = m_ui.autoStartBox->isChecked();
......
......@@ -59,7 +59,8 @@ public:
QString trCategory() const;
QWidget *createPage(QWidget *parent);
void finished(bool accepted);
void apply();
void finish() { }
public slots:
void onGdbLocationChanged();
......
......@@ -39,7 +39,8 @@
using namespace Designer::Internal;
SettingsPage::SettingsPage(QDesignerOptionsPageInterface *designerPage) :
m_designerPage(designerPage)
m_designerPage(designerPage),
m_applyOnFinish(false)
{
}
......@@ -64,10 +65,17 @@ QString SettingsPage::trCategory() const
QWidget *SettingsPage::createPage(QWidget *parent)
{
m_applyOnFinish = false;
return m_designerPage->createPage(parent);
}
void SettingsPage::finished(bool accepted)
void SettingsPage::apply()
{
m_designerPage->finish(accepted);
// FIXME: Since no cleanup should be done here, we can't call finish(true)
m_applyOnFinish = true;
}
void SettingsPage::finish()
{
m_designerPage->finish(m_applyOnFinish);
}
......@@ -59,10 +59,12 @@ public:
QString trCategory() const;
QWidget *createPage(QWidget *parent);
void finished(bool accepted);
void apply();
void finish();
private:
QDesignerOptionsPageInterface *m_designerPage;
bool m_applyOnFinish;
};
} // namespace Internal
......
......@@ -95,11 +95,10 @@ QWidget *SettingsPage::createPage(QWidget *parent)
return m_widget;
}
void SettingsPage::finished(bool accepted)
void SettingsPage::apply()
{
if (!accepted || !m_widget)
if (!m_widget)
return;
GitPlugin::instance()->setSettings(m_widget->settings());
}
......@@ -77,7 +77,8 @@ public:
QString trCategory() const;
QWidget *createPage(QWidget *parent);
void finished(bool accepted);
void apply();
void finish() { }
private:
QPointer<SettingsPageWidget> m_widget;
......
Supports Markdown
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