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

This commit is contained in:
mae
2009-02-05 19:35:25 +01:00
17 changed files with 104 additions and 33 deletions

View File

@@ -462,6 +462,7 @@ bool EditorManager::unregisterEditor(IEditor *editor)
return false;
}
void EditorManager::updateCurrentEditorAndGroup(IContext *context)
{
if (debugEditorManager)
@@ -470,7 +471,8 @@ void EditorManager::updateCurrentEditorAndGroup(IContext *context)
IEditor *editor = context ? qobject_cast<IEditor*>(context) : 0;
if (groupContext) {
m_d->m_splitter->setCurrentGroup(groupContext->editorGroup());
setCurrentEditor(0);
if (groupContext->editorGroup()->editorCount() == 0)
setCurrentEditor(0);
updateActions();
} else if (editor) {
setCurrentEditor(editor);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -124,10 +124,23 @@ void CodepasterPlugin::extensionsInitialized()
->getObject<ProjectExplorer::ProjectExplorerPlugin>();
}
QString CodepasterPlugin::serverUrl() const
{
QString url = m_settingsPage->serverUrl().toString();
if (url.startsWith("http://"))
url = url.mid(7);
if (url.endsWith('/'))
url.chop(1);
return url;
}
void CodepasterPlugin::post()
{
if (m_poster)
// FIXME: The whole m_poster thing is de facto a simple function call.
if (m_poster) {
delete m_poster;
m_poster = 0;
}
IEditor* editor = EditorManager::instance()->currentEditor();
ITextEditor* textEditor = qobject_cast<ITextEditor*>(editor);
if (!textEditor)
@@ -171,7 +184,8 @@ void CodepasterPlugin::post()
data = view.getContent();
// Submit to codepaster
m_poster = new CustomPoster(m_settingsPage->serverUrl().toString());
m_poster = new CustomPoster(serverUrl());
// Copied from cpaster. Otherwise lineendings will screw up
if (!data.contains("\r\n")) {
@@ -185,9 +199,11 @@ void CodepasterPlugin::post()
void CodepasterPlugin::fetch()
{
if (m_fetcher)
if (m_fetcher) {
delete m_fetcher;
m_fetcher = new CustomFetcher(m_settingsPage->serverUrl().toString());
m_fetcher = 0;
}
m_fetcher = new CustomFetcher(serverUrl());
QDialog dialog;
Ui_PasteSelectDialog ui;
@@ -208,7 +224,7 @@ void CodepasterPlugin::fetch()
return;
delete m_fetcher;
m_fetcher = new CustomFetcher(m_settingsPage->serverUrl().toString());
m_fetcher = new CustomFetcher(serverUrl());
m_fetcher->fetch(pasteID);
}

View File

@@ -70,6 +70,7 @@ public slots:
void fetch();
private:
QString serverUrl() const;
QAction *m_postAction;
QAction *m_fetchAction;

View File

@@ -180,7 +180,16 @@ bool FakeVimPluginPrivate::initialize()
void FakeVimPluginPrivate::installHandler(Core::IEditor *editor)
{
if (!editor)
return;
QWidget *widget = editor->widget();
if (!widget)
return;
// we can only handle QTextEdit and QPlainTextEdit
if (!qobject_cast<QTextEdit *>(widget) && !qobject_cast<QPlainTextEdit *>(widget))
return;
FakeVimHandler *handler = new FakeVimHandler(widget, widget);

View File

@@ -177,7 +177,10 @@ void QtVersionManager::apply()
}
}
}
m_versions = m_widget->versions();
qDeleteAll(m_versions);
m_versions.clear();
foreach(QtVersion *version, m_widget->versions())
m_versions.append(new QtVersion(*version));
if (versionPathsChanged)
updateDocumentation();
updateUniqueIdToIndexMap();
@@ -361,11 +364,16 @@ QtVersion *QtVersionManager::currentQtVersion() const
QtDirWidget::QtDirWidget(QWidget *parent, QList<QtVersion *> versions, int defaultVersion)
: QWidget(parent)
, m_versions(versions)
, m_defaultVersion(defaultVersion)
, m_specifyNameString(tr("<specify a name>"))
, m_specifyPathString(tr("<specify a path>"))
{
// Initialize m_versions
foreach(QtVersion *version, versions) {
m_versions.append(new QtVersion(*version));
}
m_ui.setupUi(this);
m_ui.qtPath->setExpectedKind(Core::Utils::PathChooser::Directory);
m_ui.qtPath->setPromptDialogTitle(tr("Select QTDIR"));
@@ -417,6 +425,11 @@ QtDirWidget::QtDirWidget(QWidget *parent, QList<QtVersion *> versions, int defau
updateState();
}
QtDirWidget::~QtDirWidget()
{
qDeleteAll(m_versions);
}
void QtDirWidget::addQtDir()
{
QtVersion *newVersion = new QtVersion(m_specifyNameString, m_specifyPathString);

View File

@@ -122,7 +122,6 @@ private:
// This is updated on first call to qmakeCommand
// That function is called from updateVersionInfo()
mutable QString m_qtVersionString;
Q_DISABLE_COPY(QtVersion);
};
@@ -131,6 +130,7 @@ class QtDirWidget : public QWidget
Q_OBJECT
public:
QtDirWidget(QWidget *parent, QList<QtVersion *> versions, int defaultVersion);
~QtDirWidget();
QList<QtVersion *> versions() const;
int defaultVersion() const;
void finish();