Commit fc67b043 authored by Olli Werwolff's avatar Olli Werwolff
Browse files

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

parents 608ec497 072e03a5
......@@ -74,7 +74,7 @@ QIcon FileIconProvider::icon(const QFileInfo &fileInfo)
// Disabled since for now we'll make sure that all icons fit with our
// own custom icons by returning an empty one if we don't know it.
#if 0
#ifdef Q_OS_WIN
// This is incorrect if the OS does not always return the same icon for the
// same suffix (Mac OS X), but should speed up the retrieval a lot ...
icon = m_systemIconProvider.icon(fileInfo);
......@@ -127,7 +127,7 @@ void FileIconProvider::registerIconOverlayForSuffix(const QIcon &icon, const QSt
QIcon FileIconProvider::iconForSuffix(const QString &suffix) const
{
QIcon icon;
#ifndef Q_OS_WIN // On windows we use the file system icons
if (suffix.isEmpty())
return icon;
......@@ -138,7 +138,7 @@ QIcon FileIconProvider::iconForSuffix(const QString &suffix) const
break;
}
}
#endif
return icon;
}
......
......@@ -1054,3 +1054,11 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
break;
}
}
// Mac style reimplements this to control the
// focus widget among other things
bool ManhattanStyle::event(QEvent *e)
{
Q_ASSERT(d->style);
return d->style->event(e);
}
......@@ -78,6 +78,9 @@ public:
void unpolish(QWidget *widget);
void unpolish(QApplication *app);
protected:
bool event(QEvent *e);
protected Q_SLOTS:
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const;
int layoutSpacingImplementation(QSizePolicy::ControlType control1,
......
......@@ -248,8 +248,6 @@ void CentralWidget::setLastShownPages()
}
setSource(url);
}
updateBrowserFont();
}
bool CentralWidget::hasSelection() const
......@@ -407,24 +405,6 @@ void CentralWidget::setSourceInNewTab(const QUrl &url)
tabWidget->setCurrentIndex(tabWidget->addTab(viewer,
quoteTabTitle(viewer->documentTitle())));
#if defined(QT_NO_WEBKIT)
QFont font = qApp->font();
if (helpEngine->customValue(QLatin1String("useBrowserFont")).toBool())
font = qVariantValue<QFont>(helpEngine->customValue(QLatin1String("browserFont")));
viewer->setFont(font);
#else
QWebView* view = qobject_cast<QWebView*> (viewer);
if (view) {
QWebSettings* settings = QWebSettings::globalSettings();
int fontSize = settings->fontSize(QWebSettings::DefaultFontSize);
QString fontFamily = settings->fontFamily(QWebSettings::StandardFont);
settings = view->settings();
settings->setFontSize(QWebSettings::DefaultFontSize, fontSize);
settings->setFontFamily(QWebSettings::StandardFont, fontFamily);
}
#endif
connectSignals();
}
......@@ -612,36 +592,6 @@ bool CentralWidget::eventFilter(QObject *object, QEvent *e)
return QWidget::eventFilter(object, e);
}
void CentralWidget::updateBrowserFont()
{
#if defined(QT_NO_WEBKIT)
QFont font = qApp->font();
if (helpEngine->customValue(QLatin1String("useBrowserFont")).toBool())
font = qVariantValue<QFont>(helpEngine->customValue(QLatin1String("browserFont")));
QWidget* widget = 0;
for (int i = 0; i < tabWidget->count(); ++i) {
widget = tabWidget->widget(i);
if (widget->font() != font)
widget->setFont(font);
}
#else
QWebSettings* settings = QWebSettings::globalSettings();
int fontSize = settings->fontSize(QWebSettings::DefaultFontSize);
QString fontFamily = settings->fontFamily(QWebSettings::StandardFont);
QWebView* widget = 0;
for (int i = 0; i < tabWidget->count(); ++i) {
widget = qobject_cast<QWebView*> (tabWidget->widget(i));
if (widget) {
settings = widget->settings();
settings->setFontSize(QWebSettings::DefaultFontSize, fontSize);
settings->setFontFamily(QWebSettings::StandardFont, fontFamily);
}
}
#endif
}
bool CentralWidget::find(const QString &txt, QTextDocument::FindFlags findFlags,
bool incremental)
{
......
......@@ -85,7 +85,7 @@ public:
void activateTab(bool onlyHelpViewer = false);
bool find(const QString &txt, QTextDocument::FindFlags findFlags, bool incremental);
void setLastShownPages();
static CentralWidget *instance();
public slots:
......@@ -98,7 +98,6 @@ public slots:
void print();
void pageSetup();
void printPreview();
void updateBrowserFont();
void setSource(const QUrl &url);
void setSourceInNewTab(const QUrl &url);
HelpViewer *newEmptyTab();
......
......@@ -54,46 +54,34 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE
QFormLayout *layout = new QFormLayout();
layout->setMargin(0);
m_executableLineEdit = new QLineEdit;
QToolButton *exectuableToolButton = new QToolButton();
exectuableToolButton->setText("...");
QHBoxLayout *hl = new QHBoxLayout;
hl->addWidget(m_executableLineEdit);
hl->addWidget(exectuableToolButton);
layout->addRow("Executable", hl);
m_executableChooser = new Core::Utils::PathChooser();
m_executableChooser->setExpectedKind(Core::Utils::PathChooser::File);
layout->addRow("Executable:", m_executableChooser);
m_commandLineArgumentsLineEdit = new QLineEdit;
layout->addRow("Arguments", m_commandLineArgumentsLineEdit);
m_commandLineArgumentsLineEdit->setMinimumWidth(200); // this shouldn't be fixed here...
layout->addRow("Arguments:", m_commandLineArgumentsLineEdit);
m_workingDirectoryLineEdit = new QLineEdit();
QToolButton *workingDirectoryToolButton = new QToolButton();
workingDirectoryToolButton->setText("...");
hl = new QHBoxLayout;
hl->addWidget(m_workingDirectoryLineEdit);
hl->addWidget(workingDirectoryToolButton);
layout->addRow("Working Directory", hl);
m_workingDirectory = new Core::Utils::PathChooser();
layout->addRow("Working Directory:", m_workingDirectory);
setLayout(layout);
changed();
connect(m_executableLineEdit, SIGNAL(textEdited(const QString&)),
this, SLOT(setExecutable(const QString&)));
connect(m_executableChooser, SIGNAL(changed()),
this, SLOT(setExecutable()));
connect(m_commandLineArgumentsLineEdit, SIGNAL(textEdited(const QString&)),
this, SLOT(setCommandLineArguments(const QString&)));
connect(m_workingDirectoryLineEdit, SIGNAL(textEdited(const QString&)),
this, SLOT(setWorkingDirectory(const QString&)));
connect(exectuableToolButton, SIGNAL(clicked(bool)),
this, SLOT(executableToolButtonClicked()));
connect(workingDirectoryToolButton, SIGNAL(clicked(bool)),
this, SLOT(workingDirectoryToolButtonClicked()));
connect(m_workingDirectory, SIGNAL(changed()),
this, SLOT(setWorkingDirectory()));
connect(m_runConfiguration, SIGNAL(changed()), this, SLOT(changed()));
}
void CustomExecutableConfigurationWidget::setExecutable(const QString &executable)
void CustomExecutableConfigurationWidget::setExecutable()
{
m_ignoreChange = true;
m_runConfiguration->setExecutable(executable);
m_runConfiguration->setExecutable(m_executableChooser->path());
m_ignoreChange = false;
}
void CustomExecutableConfigurationWidget::setCommandLineArguments(const QString &commandLineArguments)
......@@ -102,47 +90,21 @@ void CustomExecutableConfigurationWidget::setCommandLineArguments(const QString
m_runConfiguration->setCommandLineArguments(commandLineArguments);
m_ignoreChange = false;
}
void CustomExecutableConfigurationWidget::setWorkingDirectory(const QString &workingDirectory)
void CustomExecutableConfigurationWidget::setWorkingDirectory()
{
m_ignoreChange = true;
m_runConfiguration->setWorkingDirectory(workingDirectory);
m_runConfiguration->setWorkingDirectory(m_workingDirectory->path());
m_ignoreChange = false;
}
void CustomExecutableConfigurationWidget::executableToolButtonClicked()
{
QString newValue;
QString executableFilter;
#ifdef Q_OS_WIN
executableFilter = "Executable (*.exe)";
#endif
newValue = QFileDialog::getOpenFileName(this, "Executable", "", executableFilter);
if (!newValue.isEmpty()) {
m_executableLineEdit->setText(newValue);
setExecutable(newValue);
}
}
void CustomExecutableConfigurationWidget::workingDirectoryToolButtonClicked()
{
QString newValue;
QString executableFilter;
newValue = QFileDialog::getExistingDirectory(this, "Directory", m_workingDirectoryLineEdit->text());
if (newValue.isEmpty()) {
m_workingDirectoryLineEdit->setText(newValue);
setWorkingDirectory(newValue);
}
}
void CustomExecutableConfigurationWidget::changed()
{
// We triggered the change, don't update us
if (m_ignoreChange)
return;
m_executableLineEdit->setText(m_runConfiguration->baseExecutable());
m_executableChooser->setPath(m_runConfiguration->baseExecutable());
m_commandLineArgumentsLineEdit->setText(ProjectExplorer::Environment::joinArgumentList(m_runConfiguration->commandLineArguments()));
m_workingDirectoryLineEdit->setText(m_runConfiguration->baseWorkingDirectory());
m_workingDirectory->setPath(m_runConfiguration->baseWorkingDirectory());
}
CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Project *pro)
......
......@@ -36,6 +36,8 @@
#include "applicationrunconfiguration.h"
#include <utils/pathchooser.h>
#include <QtGui/QToolButton>
QT_BEGIN_NAMESPACE
......@@ -108,18 +110,16 @@ public:
CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc);
private slots:
void changed();
void executableToolButtonClicked();
void workingDirectoryToolButtonClicked();
void setExecutable(const QString &executable);
void setExecutable();
void setCommandLineArguments(const QString &commandLineArguments);
void setWorkingDirectory(const QString &workingDirectory);
void setWorkingDirectory();
private:
bool m_ignoreChange;
CustomExecutableRunConfiguration *m_runConfiguration;
QLineEdit *m_executableLineEdit;
Core::Utils::PathChooser *m_executableChooser;
QLineEdit *m_commandLineArgumentsLineEdit;
QLineEdit *m_workingDirectoryLineEdit;
Core::Utils::PathChooser *m_workingDirectory;
};
}
}
......
......@@ -2508,7 +2508,8 @@ bool Parser::parseBoolLiteral(ExpressionAST *&node)
bool Parser::parseNumericLiteral(ExpressionAST *&node)
{
if (LA() == T_INT_LITERAL || LA() == T_FLOAT_LITERAL || LA() == T_CHAR_LITERAL) {
if (LA() == T_INT_LITERAL || LA() == T_FLOAT_LITERAL ||
LA() == T_CHAR_LITERAL || LA() == T_WIDE_CHAR_LITERAL) {
NumericLiteralAST *ast = new (_pool) NumericLiteralAST;
ast->token = consumeToken();
node = ast;
......
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