Commit 8f7e68c6 authored by mae's avatar mae

Merge branch '0.9.1-beta' of git@scm.dev.nokia.troll.no:creator/mainline into 0.9.1-beta

parents 18c84711 0104dd41
......@@ -107,6 +107,8 @@ void TypeOfExpression::processEnvironment(QMap<QString, Document::Ptr> documents
Document::Ptr doc, Environment *env,
QSet<QString> *processed) const
{
if (! doc)
return;
if (processed->contains(doc->fileName()))
return;
processed->insert(doc->fileName());
......
......@@ -46,11 +46,12 @@
#include <QtGui/QHBoxLayout>
#include <QtGui/QLineEdit>
#include <QtGui/QToolButton>
#include <QtGui/QPushButton>
namespace Core {
namespace Utils {
#ifdef Q_OS_OSX
#ifdef Q_OS_MAC
/*static*/ const char * const PathChooser::browseButtonLabel = "Choose...";
#else
/*static*/ const char * const PathChooser::browseButtonLabel = "Browse...";
......@@ -112,7 +113,11 @@ PathChooser::PathChooser(QWidget *parent) :
hLayout->addWidget(m_d->m_lineEdit);
hLayout->setSizeConstraint(QLayout::SetMinimumSize);
#ifdef Q_OS_MAC
QPushButton *browseButton = new QPushButton;
#else
QToolButton *browseButton = new QToolButton;
#endif
browseButton->setText(tr(browseButtonLabel));
connect(browseButton, SIGNAL(clicked()), this, SLOT(slotBrowse()));
......
......@@ -334,6 +334,10 @@ NavigationSubWidget::NavigationSubWidget(NavigationWidget *parentWidget)
m_navigationComboBox = new NavComboBox(this);
m_navigationWidget = 0;
#ifdef Q_OS_MAC
// this is to avoid ugly tool bar behavior
m_navigationComboBox->setMaximumWidth(130);
#endif
m_toolbar = new QToolBar(this);
m_toolbar->setContentsMargins(0, 0, 0, 0);
......
......@@ -88,11 +88,15 @@ QWidget *GdbOptionPage::createPage(QWidget *parent)
{
QWidget *w = new QWidget(parent);
m_ui.setupUi(w);
m_ui.gdbLocationEdit->setText(m_settings->m_gdbCmd);
m_ui.gdbLocationChooser->setExpectedKind(Core::Utils::PathChooser::Command);
m_ui.gdbLocationChooser->setPromptDialogTitle(tr("Choose Gdb Location"));
m_ui.gdbLocationChooser->setPath(m_settings->m_gdbCmd);
m_ui.scriptFileChooser->setExpectedKind(Core::Utils::PathChooser::File);
m_ui.scriptFileChooser->setPromptDialogTitle(tr("Choose Location of Startup Script File"));
m_ui.scriptFileChooser->setPath(m_settings->m_scriptFile);
m_ui.environmentEdit->setText(m_settings->m_gdbEnv);
m_ui.autoStartBox->setChecked(m_settings->m_autoRun);
m_ui.autoQuitBox->setChecked(m_settings->m_autoQuit);
m_ui.gdbStartupScriptEdit->setText(m_settings->m_scriptFile);
// FIXME
m_ui.autoStartBox->hide();
......@@ -100,32 +104,22 @@ QWidget *GdbOptionPage::createPage(QWidget *parent)
m_ui.environmentEdit->hide();
m_ui.labelEnvironment->hide();
connect(m_ui.browseForGdbButton, SIGNAL(clicked()),
this, SLOT(browseForGdb()));
connect(m_ui.browseForScriptButton, SIGNAL(clicked()),
this, SLOT(browseForScript()));
connect(m_ui.gdbLocationChooser, SIGNAL(changed()),
this, SLOT(onGdbLocationChanged()));
connect(m_ui.scriptFileChooser, SIGNAL(changed()),
this, SLOT(onScriptFileChanged()));
return w;
}
void GdbOptionPage::browseForGdb()
void GdbOptionPage::onGdbLocationChanged()
{
QString fileName = QFileDialog::getOpenFileName(m_ui.browseForGdbButton,
"Browse for gdb executable");
if (fileName.isEmpty())
return;
m_settings->m_gdbCmd = fileName;
m_ui.gdbLocationEdit->setText(fileName);
m_settings->m_gdbCmd = m_ui.gdbLocationChooser->path();
}
void GdbOptionPage::browseForScript()
void GdbOptionPage::onScriptFileChanged()
{
QString fileName = QFileDialog::getOpenFileName(m_ui.browseForGdbButton,
"Browse for gdb startup script");
if (fileName.isEmpty())
return;
m_settings->m_scriptFile = fileName;
m_ui.gdbStartupScriptEdit->setText(fileName);
m_settings->m_scriptFile = m_ui.scriptFileChooser->path();
}
void GdbOptionPage::finished(bool accepted)
......@@ -133,11 +127,11 @@ void GdbOptionPage::finished(bool accepted)
if (!accepted)
return;
m_settings->m_gdbCmd = m_ui.gdbLocationEdit->text();
m_settings->m_gdbCmd = m_ui.gdbLocationChooser->path();
m_settings->m_gdbEnv = m_ui.environmentEdit->text();
m_settings->m_autoRun = m_ui.autoStartBox->isChecked();
m_settings->m_autoQuit = m_ui.autoQuitBox->isChecked();
m_settings->m_scriptFile = m_ui.gdbStartupScriptEdit->text();
m_settings->m_scriptFile = m_ui.scriptFileChooser->path();
Core::ICore *coreIFace = m_pm->getObject<Core::ICore>();
if (!coreIFace || !coreIFace->settings())
......
......@@ -62,8 +62,8 @@ public:
void finished(bool accepted);
public slots:
void browseForGdb();
void browseForScript();
void onGdbLocationChanged();
void onScriptFileChanged();
private:
ExtensionSystem::PluginManager *m_pm;
......
......@@ -32,10 +32,7 @@
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="1">
<widget class="QLineEdit" name="gdbLocationEdit"/>
</item>
<item row="1" column="1" colspan="2">
<item row="1" column="1">
<widget class="QLineEdit" name="environmentEdit"/>
</item>
<item row="0" column="0">
......@@ -46,9 +43,6 @@
<property name="text">
<string>Gdb Location:</string>
</property>
<property name="buddy">
<cstring>gdbLocationEdit</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
......@@ -61,40 +55,6 @@
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="browseForGdbButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../coreplugin/core.qrc">
<normaloff>:/qworkbench/images/fileopen.png</normaloff>:/qworkbench/images/fileopen.png</iconset>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="gdbStartupScriptEdit"/>
</item>
<item row="2" column="2">
<widget class="QToolButton" name="browseForScriptButton">
<property name="minimumSize">
<size>
<width>21</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../coreplugin/core.qrc">
<normaloff>:/qworkbench/images/fileopen.png</normaloff>:/qworkbench/images/fileopen.png</iconset>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelGdbStartupScript">
<property name="toolTip">
......@@ -105,6 +65,12 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Core::Utils::PathChooser" name="scriptFileChooser" native="true"/>
</item>
<item row="0" column="1">
<widget class="Core::Utils::PathChooser" name="gdbLocationChooser" native="true"/>
</item>
</layout>
</widget>
</item>
......@@ -137,6 +103,14 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Core::Utils::PathChooser</class>
<extends>QWidget</extends>
<header location="global">utils/pathchooser.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../coreplugin/core.qrc"/>
</resources>
......
......@@ -411,7 +411,7 @@ static QString niceType(QString type)
"std::allocator<wchar_t> >", "std::wstring");
// std::vector
static QRegExp re1("std::vector<(.*)\\s*,std::allocator<(.*)>\\s*>");
static QRegExp re1("std::vector<(.*), std::allocator<(.*)>\\s*>");
re1.setMinimal(true);
for (int i = 0; i != 10; ++i) {
if (re1.indexIn(type) == -1 || re1.cap(1) != re1.cap(2))
......@@ -420,7 +420,7 @@ static QString niceType(QString type)
}
// std::list
static QRegExp re2("std::list<(.*)\\s*,std::allocator<(.*)>\\s*>");
static QRegExp re2("std::list<(.*), std::allocator<(.*)>\\s*>");
re2.setMinimal(true);
for (int i = 0; i != 10; ++i) {
if (re2.indexIn(type) == -1 || re2.cap(1) != re2.cap(2))
......@@ -428,6 +428,17 @@ static QString niceType(QString type)
type.replace(re2.cap(0), "std::list<" + re2.cap(1) + ">");
}
// std::map
static QRegExp re3("std::map<(.*), (.*), std::less<(.*)\\s*>, "
"std::allocator<std::pair<const (.*), (.*)\\s*> > >");
re3.setMinimal(true);
for (int i = 0; i != 10; ++i) {
if (re3.indexIn(type) == -1 || re3.cap(1) != re3.cap(3)
|| re3.cap(1) != re3.cap(4) || re3.cap(2) != re3.cap(5))
break;
type.replace(re3.cap(0), "std::map<" + re3.cap(1) + ", " + re3.cap(2) + ">");
}
type.replace(" >", ">");
}
return type;
......
......@@ -53,6 +53,7 @@
#include <QtNetwork/QHostAddress>
#include <iostream>
#include <map>
#include <list>
#include <stack>
#include <string>
......@@ -131,7 +132,6 @@ void testArray()
}
}
void testQByteArray()
{
QByteArray ba = "Hello";
......@@ -142,7 +142,6 @@ void testQByteArray()
ba += 2;
}
void testQHash()
{
QHash<int, float> hgg0;
......@@ -412,6 +411,41 @@ void testStdList()
vec.push_back(false);
}
void testStdMap()
{
std::map<uint, QStringList> ggl;
ggl[11] = QStringList() << "11";
ggl[22] = QStringList() << "22";
typedef std::map<uint, QStringList> T;
T ggt;
ggt[11] = QStringList() << "11";
ggt[22] = QStringList() << "22";
#if 0
std::map<uint, float> gg0;
gg0[11] = 11.0;
gg0[22] = 22.0;
std::map<QString, float> gg1;
gg1["22.0"] = 22.0;
std::map<int, QString> gg2;
gg2[22] = "22.0";
std::map<QString, Foo> gg3;
gg3["22.0"] = Foo(22);
gg3["33.0"] = Foo(33);
QObject ob;
std::map<QString, QPointer<QObject> > map;
map.insert("Hallo", QPointer<QObject>(&ob));
map.insert("Welt", QPointer<QObject>(&ob));
map.insert(".", QPointer<QObject>(&ob));
#endif
}
void testStdStack()
{
std::stack<int *> plist1;
......@@ -795,6 +829,7 @@ int main(int argc, char *argv[])
testArray();
testStdList();
testStdMap();
testStdStack();
testStdString();
testStdVector();
......
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