Merge remote-tracking branch 'origin/KDE/4.10'

This commit is contained in:
Frank Reininghaus 2013-05-02 19:45:08 +02:00
commit 692e7d4d32
3 changed files with 17 additions and 14 deletions

View file

@ -294,7 +294,7 @@ void KStandardItemListWidget::paint(QPainter* painter, const QStyleOptionGraphic
}
painter->setFont(m_customizedFont);
painter->setPen(m_isHidden ? m_additionalInfoTextColor : textColor());
painter->setPen(textColor());
const TextInfo* textInfo = m_textInfo.value("text");
if (!textInfo) {
@ -523,8 +523,12 @@ void KStandardItemListWidget::setTextColor(const QColor& color)
QColor KStandardItemListWidget::textColor() const
{
if (m_customTextColor.isValid() && !isSelected()) {
return m_customTextColor;
if (!isSelected()) {
if (m_isHidden) {
return m_additionalInfoTextColor;
} else if (m_customTextColor.isValid()) {
return m_customTextColor;
}
}
const QPalette::ColorGroup group = isActiveWindow() ? QPalette::Active : QPalette::Inactive;

View file

@ -31,6 +31,7 @@
#include <KIO/JobUiDelegate>
#include <QBoxLayout>
#include <QDir>
#include <QShowEvent>
TerminalPanel::TerminalPanel(QWidget* parent) :
@ -183,8 +184,12 @@ void TerminalPanel::slotKonsolePartCurrentDirectoryChanged(const QString& dir)
{
m_konsolePartCurrentDirectory = dir;
// Only change the view URL if 'dir' is different from the current view URL.
// Note that the current view URL could also be a symbolic link to 'dir'
// -> use QDir::canonicalPath() to check that.
const KUrl oldUrl(url());
const KUrl newUrl(dir);
if (newUrl != url()) {
if (newUrl != oldUrl && dir != QDir(oldUrl.path()).canonicalPath()) {
emit changeUrl(newUrl);
}
}

View file

@ -147,16 +147,10 @@ void RenameDialog::slotTextChanged(const QString& newName)
bool enable = !newName.isEmpty() && (newName != QLatin1String("..")) && (newName != QLatin1String("."));
if (enable && !m_renameOneItem) {
// Assure that the new name contains exactly one # (or a connected sequence of #'s)
const int minSplitCount = 1;
int maxSplitCount = 2;
if (newName.startsWith(QLatin1Char('#'))) {
--maxSplitCount;
}
if (newName.endsWith(QLatin1Char('#'))) {
--maxSplitCount;
}
const int splitCount = newName.split(QLatin1Char('#'), QString::SkipEmptyParts).count();
enable = enable && (splitCount >= minSplitCount) && (splitCount <= maxSplitCount);
const int count = newName.count(QLatin1Char('#'));
const int first = newName.indexOf(QLatin1Char('#'));
const int last = newName.lastIndexOf(QLatin1Char('#'));
enable = (last - first + 1 == count);
}
enableButtonOk(enable);
}