mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
Merge remote-tracking branch 'origin/KDE/4.10'
This commit is contained in:
commit
692e7d4d32
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue