Merge remote-tracking branch 'origin/3.1'

Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/plugins/cpptools/cppcompletion_test.cpp

Change-Id: Ic5e75b3ef164de664a1449ffa8579beaf5b02521
This commit is contained in:
Eike Ziller
2014-04-08 11:18:40 +02:00
39 changed files with 305 additions and 169 deletions

View File

@@ -49,6 +49,7 @@ namespace {
}
static const char kKeyboardSettingsKey[] = "KeyboardShortcuts";
static const char kKeyboardSettingsTransferredKey[] = "OldSettingsTransferred";
using namespace Core;
using namespace Core::Internal;
@@ -505,10 +506,16 @@ static const char oldSequenceKey[] = "Keysequence";
void ActionManagerPrivate::initialize()
{
// TODO remove me after some period after 3.1
// TODO also remove the old settings after some period after 3.1
// settings->remove(QLatin1String(oldSettingsGroup));
// settings->contains(QLatin1String(kKeyboardSettingsKey) + QLatin1Char('/')
// + QLatin1String(kKeyboardSettingsTransferredKey))
// check if settings in old style (pre 3.1) exist
QSettings *settings = Core::ICore::settings();
if (settings->contains(QLatin1String(kKeyboardSettingsKey)))
if (settings->contains(QLatin1String(kKeyboardSettingsKey) + QLatin1Char('/')
+ QLatin1String(kKeyboardSettingsTransferredKey))) {
return;
}
// move old settings style to new settings style
QMap<Id, QKeySequence> shortcutMap;
const int shortcuts = settings->beginReadArray(QLatin1String(oldSettingsGroup));
@@ -521,14 +528,13 @@ void ActionManagerPrivate::initialize()
settings->endArray();
// write settings in new style
settings->beginGroup(QLatin1String(kKeyboardSettingsKey));
settings->setValue(QLatin1String(kKeyboardSettingsTransferredKey), true);
QMapIterator<Id, QKeySequence> it(shortcutMap);
while (it.hasNext()) {
it.next();
settings->setValue(it.key().toString(), it.value().toString());
}
settings->endGroup();
// remove old settings
settings->remove(QLatin1String(oldSettingsGroup));
}
void ActionManagerPrivate::saveSettings(QSettings *settings)

View File

@@ -337,6 +337,8 @@ void FindToolBar::updateFindAction()
m_findInDocumentAction->setEnabled(enabled);
m_findNextSelectedAction->setEnabled(enabled);
m_findPreviousSelectedAction->setEnabled(enabled);
if (QApplication::clipboard()->supportsFindBuffer())
m_enterFindStringAction->setEnabled(enabled);
}
void FindToolBar::updateToolBar()
@@ -358,8 +360,6 @@ void FindToolBar::updateToolBar()
m_wholeWordAction->setEnabled(enabled);
m_regularExpressionAction->setEnabled(enabled);
m_preserveCaseAction->setEnabled(replaceEnabled && !hasFindFlag(FindRegularExpression));
if (QApplication::clipboard()->supportsFindBuffer())
m_enterFindStringAction->setEnabled(enabled);
bool replaceFocus = m_ui.replaceEdit->hasFocus();
m_ui.findEdit->setEnabled(enabled);
m_ui.findLabel->setEnabled(enabled);
@@ -516,6 +516,7 @@ void FindToolBar::invokeResetIncrementalSearch()
void FindToolBar::putSelectionToFindClipboard()
{
openFind(false);
const QString text = m_currentDocumentFind->currentFindString();
QApplication::clipboard()->setText(text, QClipboard::FindBuffer);
setFindText(text);