forked from qt-creator/qt-creator
Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline
This commit is contained in:
@@ -357,7 +357,7 @@ public:
|
||||
QString removeSelectedText();
|
||||
int anchor() const { return m_anchor; }
|
||||
int position() const { return m_tc.position(); }
|
||||
QString selectedText() const;
|
||||
QString selectedText(MoveType moveType = MoveExclusive) const;
|
||||
|
||||
// undo handling
|
||||
void undo();
|
||||
@@ -764,7 +764,8 @@ void FakeVimHandler::Private::updateSelection()
|
||||
int anchorPos = m_marks['<'];
|
||||
//qDebug() << "POS: " << cursorPos << " ANCHOR: " << anchorPos;
|
||||
if (m_visualMode == VisualCharMode) {
|
||||
sel.cursor.setPosition(anchorPos, KeepAnchor);
|
||||
sel.cursor.setPosition(qMin(cursorPos, anchorPos), MoveAnchor);
|
||||
sel.cursor.setPosition(qMax(cursorPos, anchorPos) + 1, KeepAnchor);
|
||||
selections.append(sel);
|
||||
} else if (m_visualMode == VisualLineMode) {
|
||||
sel.cursor.setPosition(qMin(cursorPos, anchorPos), MoveAnchor);
|
||||
@@ -1476,7 +1477,20 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|
||||
moveLeft();
|
||||
setAnchor();
|
||||
m_submode = YankSubMode;
|
||||
} else if (key == 'y' && m_visualMode == VisualLineMode) {
|
||||
} else if (key == 'y' && m_visualMode == VisualCharMode) {
|
||||
m_registers[m_register] = selectedText(MoveInclusive);
|
||||
setPosition(qMin(position(), anchor()));
|
||||
leaveVisualMode();
|
||||
finishMovement();
|
||||
} else if (key == 'Y' && m_visualMode == NoVisualMode) {
|
||||
const int line = cursorLineInDocument() + 1;
|
||||
selectRange(line, line + count() - 1);
|
||||
m_registers[m_register] = selectedText();
|
||||
setPosition(qMin(position(), anchor()));
|
||||
finishMovement();
|
||||
} else if ((key == 'y' && m_visualMode == VisualLineMode)
|
||||
|| (key == 'Y' && m_visualMode == VisualLineMode)
|
||||
|| (key == 'Y' && m_visualMode == VisualCharMode)) {
|
||||
int beginLine = lineForPosition(m_marks['<']);
|
||||
int endLine = lineForPosition(m_marks['>']);
|
||||
selectRange(beginLine, endLine);
|
||||
@@ -1484,13 +1498,9 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|
||||
setPosition(qMin(position(), anchor()));
|
||||
moveToStartOfLine();
|
||||
leaveVisualMode();
|
||||
updateSelection();
|
||||
} else if (key == 'Y') {
|
||||
moveToStartOfLine();
|
||||
setAnchor();
|
||||
moveDown(count());
|
||||
m_moveType = MoveLineWise;
|
||||
finishMovement();
|
||||
} else if ((key == 'y' || key == 'Y') && m_visualMode == VisualBlockMode) {
|
||||
// not implemented
|
||||
} else if (key == 'z') {
|
||||
m_submode = ZSubMode;
|
||||
} else if (key == 'Z') {
|
||||
@@ -2403,10 +2413,15 @@ QString FakeVimHandler::Private::lastSearchString() const
|
||||
return m_searchHistory.empty() ? QString() : m_searchHistory.back();
|
||||
}
|
||||
|
||||
QString FakeVimHandler::Private::selectedText() const
|
||||
QString FakeVimHandler::Private::selectedText(MoveType moveType) const
|
||||
{
|
||||
int beginPos = qMin(position(), anchor());
|
||||
int endPos = qMax(position(), anchor());
|
||||
if (moveType == MoveInclusive)
|
||||
++endPos;
|
||||
QTextCursor tc = m_tc;
|
||||
tc.setPosition(m_anchor, KeepAnchor);
|
||||
tc.setPosition(beginPos, MoveAnchor);
|
||||
tc.setPosition(endPos, KeepAnchor);
|
||||
return tc.selection().toPlainText();
|
||||
}
|
||||
|
||||
|
@@ -56,7 +56,7 @@ void EnvironmentModel::updateResultEnvironment()
|
||||
m_resultEnvironment.modify(m_items);
|
||||
foreach (const EnvironmentItem &item, m_items) {
|
||||
if (item.unset) {
|
||||
m_resultEnvironment.set(item.name, QLatin1String("<UNSET>"));
|
||||
m_resultEnvironment.set(item.name, tr("<UNSET>"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -128,7 +128,7 @@ QVariant EnvironmentModel::data(const QModelIndex &index, int role) const
|
||||
return m_resultEnvironment.value(m_resultEnvironment.constBegin() + index.row());
|
||||
} else {
|
||||
if (m_items.at(index.row()).unset)
|
||||
return QLatin1String("<UNSET>");
|
||||
return tr("<UNSET>");
|
||||
else
|
||||
return m_items.at(index.row()).value;
|
||||
}
|
||||
@@ -286,7 +286,7 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value,
|
||||
|
||||
QModelIndex EnvironmentModel::addVariable()
|
||||
{
|
||||
const QString &name = QLatin1String("<VARIABLE>");
|
||||
const QString name = tr("<VARIABLE>");
|
||||
if (m_mergedEnvironments) {
|
||||
int i = findInResult(name);
|
||||
if (i != -1)
|
||||
@@ -297,7 +297,7 @@ QModelIndex EnvironmentModel::addVariable()
|
||||
return index(i, 0, QModelIndex());
|
||||
}
|
||||
// Don't exist, really add them
|
||||
return addVariable(EnvironmentItem(name, QLatin1String("<VALUE>")));
|
||||
return addVariable(EnvironmentItem(name, tr("<VALUE>")));
|
||||
}
|
||||
|
||||
QModelIndex EnvironmentModel::addVariable(const EnvironmentItem &item)
|
||||
@@ -558,10 +558,12 @@ void EnvironmentWidget::updateSummaryText()
|
||||
foreach (const EnvironmentItem &item, list) {
|
||||
if (!text.isEmpty())
|
||||
text.append("<br>");
|
||||
if (item.unset)
|
||||
text.append(tr("Unset <b>%1</b>").arg(item.name));
|
||||
else
|
||||
text.append(tr("Set <b>%1</b> to <b>%2</b>").arg(item.name, item.value));
|
||||
if (item.name != EnvironmentModel::tr("<VARIABLE>")) {
|
||||
if (item.unset)
|
||||
text.append(tr("Unset <b>%1</b>").arg(item.name));
|
||||
else
|
||||
text.append(tr("Set <b>%1</b> to <b>%2</b>").arg(item.name, item.value));
|
||||
}
|
||||
}
|
||||
if (text.isEmpty())
|
||||
text = tr("Summary: No changes to Environment");
|
||||
|
@@ -120,7 +120,9 @@ RSSFetcher::RSSFetcher(int maxItems, QObject *parent)
|
||||
|
||||
void RSSFetcher::fetch(const QUrl &url)
|
||||
{
|
||||
m_http.setProxy(QNetworkProxyFactory::systemProxyForQuery(QNetworkProxyQuery(url)).first());
|
||||
QList<QNetworkProxy> proxies = QNetworkProxyFactory::systemProxyForQuery(QNetworkProxyQuery(url));
|
||||
if (proxies.count() > 0)
|
||||
m_http.setProxy(proxies.first());
|
||||
m_http.setHost(url.host());
|
||||
QString agentStr = QString("Qt-Creator/%1 (QHttp %2; %3; %4; %5 bit)")
|
||||
.arg(Core::Constants::IDE_VERSION_LONG).arg(qVersion())
|
||||
|
Reference in New Issue
Block a user