Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit c6000f25 authored by Tim Beaulen's avatar Tim Beaulen

Less deprecated functions.


svn path=/trunk/KDE/kdemultimedia/juk/; revision=595635
parent 030e24d1
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "ktrm.h" #include "ktrm.h"
#include <config-juk.h> #include <config-juk.h>
#ifdef HAVE_TUNEPIMP //Silence warning about HAVE_TUNEPIMP not being defined.
#if HAVE_TUNEPIMP #if HAVE_TUNEPIMP
#include <kapplication.h> #include <kapplication.h>
...@@ -34,7 +35,6 @@ ...@@ -34,7 +35,6 @@
#include <qevent.h> #include <qevent.h>
#include <QObject> #include <QObject>
#include <QFile> #include <QFile>
//Added by qt3to4:
#include <QCustomEvent> #include <QCustomEvent>
#include <tunepimp/tp_c.h> #include <tunepimp/tp_c.h>
...@@ -603,6 +603,7 @@ void KTRMLookup::finished() ...@@ -603,6 +603,7 @@ void KTRMLookup::finished()
delete this; delete this;
} }
#endif
#endif #endif
// vim: set et sw=4 tw=0 sta: // vim: set et sw=4 tw=0 sta:
...@@ -54,12 +54,12 @@ protected: ...@@ -54,12 +54,12 @@ protected:
virtual void mousePressEvent(QMouseEvent *e) virtual void mousePressEvent(QMouseEvent *e)
{ {
if(e->button() == Qt::LeftButton) { if(e->button() == Qt::LeftButton) {
QMouseEvent reverse(QEvent::MouseButtonPress, e->pos(), Qt::MidButton, e->state()); QMouseEvent reverse(QEvent::MouseButtonPress, e->pos(), Qt::MidButton, e->buttons(), e->modifiers());
QSlider::mousePressEvent(&reverse); QSlider::mousePressEvent(&reverse);
emit sliderPressed(); emit sliderPressed();
} }
else if(e->button() == Qt::MidButton) { else if(e->button() == Qt::MidButton) {
QMouseEvent reverse(QEvent::MouseButtonPress, e->pos(), Qt::LeftButton, e->state()); QMouseEvent reverse(QEvent::MouseButtonPress, e->pos(), Qt::LeftButton, e->buttons(), e->modifiers());
QSlider::mousePressEvent(&reverse); QSlider::mousePressEvent(&reverse);
} }
} }
...@@ -78,7 +78,7 @@ VolumeSlider::VolumeSlider(Qt::Orientation o, QWidget *parent) : ...@@ -78,7 +78,7 @@ VolumeSlider::VolumeSlider(Qt::Orientation o, QWidget *parent) :
void VolumeSlider::wheelEvent(QWheelEvent *e) void VolumeSlider::wheelEvent(QWheelEvent *e)
{ {
if(orientation() == Qt::Horizontal) { if(orientation() == Qt::Horizontal) {
QWheelEvent transposed(e->pos(), -(e->delta()), e->state(), e->orientation()); QWheelEvent transposed(e->pos(), -(e->delta()), e->buttons(), e->modifiers(), e->orientation());
QSlider::wheelEvent(&transposed); QSlider::wheelEvent(&transposed);
} }
else else
...@@ -151,6 +151,8 @@ SliderAction::~SliderAction() ...@@ -151,6 +151,8 @@ SliderAction::~SliderAction()
int SliderAction::plug(QWidget *parent, int index) int SliderAction::plug(QWidget *parent, int index)
{ {
Q_UNUSED(index)
m_widget = createWidget(parent); m_widget = createWidget(parent);
if(!m_widget) if(!m_widget)
...@@ -172,7 +174,7 @@ int SliderAction::plug(QWidget *parent, int index) ...@@ -172,7 +174,7 @@ int SliderAction::plug(QWidget *parent, int index)
this, SLOT(slotUpdateOrientation())); this, SLOT(slotUpdateOrientation()));
slotUpdateOrientation(); slotUpdateOrientation();
return (containerCount() - 1); return (associatedWidgets().count() - 1);
} }
else else
slotUpdateOrientation(); slotUpdateOrientation();
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
#include <kdebug.h> #include <kdebug.h>
#include <qpainter.h> #include <qpainter.h>
//Added by qt3to4:
#include <QPixmap> #include <QPixmap>
#include <QLabel> #include <QLabel>
#include <QPalette>
#include "splashscreen.h" #include "splashscreen.h"
...@@ -73,16 +73,20 @@ void SplashScreen::update() ...@@ -73,16 +73,20 @@ void SplashScreen::update()
// protected members // protected members
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
SplashScreen::SplashScreen() : QLabel(0 , "splashScreen", Qt::WStyle_Splash) SplashScreen::SplashScreen() : QLabel(0, Qt::WStyle_Splash)
{ {
setObjectName("splashScreen");
QPixmap background = UserIcon("splash"); QPixmap background = UserIcon("splash");
resize(background.size()); resize(background.size());
setPaletteBackgroundPixmap(background); QPalette palette;
palette.setBrush(backgroundRole(), QBrush(background));
setMargin(7); setMargin(7);
setAlignment(Qt::AlignLeft | Qt::AlignBottom); setAlignment(Qt::AlignLeft | Qt::AlignBottom);
setPaletteForegroundColor(QColor(107, 158, 194)); palette.setColor(foregroundRole(), QColor(107, 158, 194));
setPalette(palette);
QFont f = font(); QFont f = font();
f.setPixelSize(10); f.setPixelSize(10);
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include <QToolTip> #include <QToolTip>
#include <QLayout> #include <QLayout>
//Added by qt3to4:
#include <QMouseEvent> #include <QMouseEvent>
#include <QLabel> #include <QLabel>
#include <Q3Frame> #include <Q3Frame>
...@@ -88,7 +87,7 @@ StatusLabel::StatusLabel(PlaylistInterface *playlist, QWidget *parent, const cha ...@@ -88,7 +87,7 @@ StatusLabel::StatusLabel(PlaylistInterface *playlist, QWidget *parent, const cha
jumpBox->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum); jumpBox->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum);
QPushButton *jumpButton = new QPushButton(jumpBox); QPushButton *jumpButton = new QPushButton(jumpBox);
jumpButton->setPixmap(SmallIcon("up")); jumpButton->setIcon(SmallIcon("up"));
jumpButton->setFlat(true); jumpButton->setFlat(true);
jumpButton->setToolTip( i18n("Jump to the currently playing item")); jumpButton->setToolTip( i18n("Jump to the currently playing item"));
...@@ -115,7 +114,7 @@ void StatusLabel::updateCurrent() ...@@ -115,7 +114,7 @@ void StatusLabel::updateCurrent()
QString text = file.tag()->artist() + mid + file.tag()->title(); QString text = file.tag()->artist() + mid + file.tag()->title();
m_trackLabel->setText(text); m_trackLabel->setText(text);
m_playlistLabel->setText(playlist()->name().simplifyWhiteSpace()); m_playlistLabel->setText(playlist()->name().simplified());
} }
} }
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <q3valuevector.h> #include <q3valuevector.h>
#include <q3stylesheet.h> #include <q3stylesheet.h>
#include <qpalette.h> #include <qpalette.h>
//Added by qt3to4:
#include <QWheelEvent> #include <QWheelEvent>
#include <QPixmap> #include <QPixmap>
#include <QEvent> #include <QEvent>
...@@ -166,8 +166,8 @@ SystemTray::SystemTray(QWidget *parent) : KSystemTrayIcon(parent), ...@@ -166,8 +166,8 @@ SystemTray::SystemTray(QWidget *parent) : KSystemTrayIcon(parent),
m_playPix = createPixmap("player_play"); m_playPix = createPixmap("player_play");
m_pausePix = createPixmap("player_pause"); m_pausePix = createPixmap("player_pause");
m_forwardPix = loadIcon("player_end").pixmap(); m_forwardPix = SmallIcon("player_end");
m_backPix = loadIcon("player_start").pixmap(); m_backPix = SmallIcon("player_start");
setIcon(m_appPix); setIcon(m_appPix);
...@@ -203,7 +203,8 @@ SystemTray::SystemTray(QWidget *parent) : KSystemTrayIcon(parent), ...@@ -203,7 +203,8 @@ SystemTray::SystemTray(QWidget *parent) : KSystemTrayIcon(parent),
cm->addAction( action("togglePopups") ); cm->addAction( action("togglePopups") );
m_fadeTimer = new QTimer(this, "systrayFadeTimer"); m_fadeTimer = new QTimer(this);
m_fadeTimer->setObjectName("systrayFadeTimer");
connect(m_fadeTimer, SIGNAL(timeout()), SLOT(slotNextStep())); connect(m_fadeTimer, SIGNAL(timeout()), SLOT(slotNextStep()));
if(PlayerManager::instance()->playing()) if(PlayerManager::instance()->playing())
...@@ -277,8 +278,11 @@ void SystemTray::slotNextStep() ...@@ -277,8 +278,11 @@ void SystemTray::slotNextStep()
result = interpolateColor(m_step); result = interpolateColor(m_step);
for(int i = 0; i < m_labels.capacity() && m_labels[i]; ++i) for(int i = 0; i < m_labels.capacity() && m_labels[i]; ++i) {
m_labels[i]->setPaletteForegroundColor(result); QPalette palette;
palette.setColor(m_labels[i]->foregroundRole(), result);
m_labels[i]->setPalette(palette);
}
if(m_step == STEPS) { if(m_step == STEPS) {
m_step = 0; m_step = 0;
...@@ -444,7 +448,7 @@ bool SystemTray::buttonsToLeft() const ...@@ -444,7 +448,7 @@ bool SystemTray::buttonsToLeft() const
QPixmap SystemTray::createPixmap(const QString &pixName) QPixmap SystemTray::createPixmap(const QString &pixName)
{ {
QImage bgImage = m_appPix.pixmap().toImage(); // Probably 22x22 QImage bgImage = m_appPix.pixmap(22).toImage(); // 22x22
QImage fgImage = SmallIcon(pixName).toImage(); // Should be 16x16 QImage fgImage = SmallIcon(pixName).toImage(); // Should be 16x16
KIconEffect::semiTransparent(bgImage); KIconEffect::semiTransparent(bgImage);
...@@ -460,11 +464,13 @@ void SystemTray::createButtonBox(QWidget *parent) ...@@ -460,11 +464,13 @@ void SystemTray::createButtonBox(QWidget *parent)
buttonBox->setSpacing(3); buttonBox->setSpacing(3);
QPushButton *forwardButton = new QPushButton(m_forwardPix, 0, buttonBox, "popup_forward"); QPushButton *forwardButton = new QPushButton(m_forwardPix, 0, buttonBox);
forwardButton->setObjectName("popup_forward");
forwardButton->setFlat(true); forwardButton->setFlat(true);
connect(forwardButton, SIGNAL(clicked()), SLOT(slotForward())); connect(forwardButton, SIGNAL(clicked()), SLOT(slotForward()));
QPushButton *backButton = new QPushButton(m_backPix, 0, buttonBox, "popup_back"); QPushButton *backButton = new QPushButton(m_backPix, 0, buttonBox);
backButton->setObjectName("popup_back");
backButton->setFlat(true); backButton->setFlat(true);
connect(backButton, SIGNAL(clicked()), SLOT(slotBack())); connect(backButton, SIGNAL(clicked()), SLOT(slotBack()));
} }
...@@ -501,7 +507,7 @@ void SystemTray::addCoverButton(QWidget *parent, const QPixmap &cover) ...@@ -501,7 +507,7 @@ void SystemTray::addCoverButton(QWidget *parent, const QPixmap &cover)
{ {
QPushButton *coverButton = new QPushButton(parent); QPushButton *coverButton = new QPushButton(parent);
coverButton->setPixmap(cover); coverButton->setIcon(cover);
coverButton->setFixedSize(cover.size()); coverButton->setFixedSize(cover.size());
coverButton->setFlat(true); coverButton->setFlat(true);
...@@ -536,7 +542,7 @@ void SystemTray::setToolTip(const QString &tip, const QPixmap &cover) ...@@ -536,7 +542,7 @@ void SystemTray::setToolTip(const QString &tip, const QPixmap &cover)
QImage coverImage = myCover.toImage(); QImage coverImage = myCover.toImage();
if(coverImage.size().width() > 32 || coverImage.size().height() > 32) if(coverImage.size().width() > 32 || coverImage.size().height() > 32)
coverImage = coverImage.smoothScale(32, 32); coverImage = coverImage.scaled(32, 32, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
Q3MimeSourceFactory::defaultFactory()->setImage("tipCover", coverImage); Q3MimeSourceFactory::defaultFactory()->setImage("tipCover", coverImage);
...@@ -560,7 +566,7 @@ void SystemTray::wheelEvent(QWheelEvent *e) ...@@ -560,7 +566,7 @@ void SystemTray::wheelEvent(QWheelEvent *e)
// that a reinterpret_cast isn't portable when combined with multiple // that a reinterpret_cast isn't portable when combined with multiple
// inheritance. (This is why I don't check the result.) // inheritance. (This is why I don't check the result.)
switch(e->state()) { switch(e->modifiers()) {
case Qt::ShiftButton: case Qt::ShiftButton:
if(e->delta() > 0) if(e->delta() > 0)
action("volumeUp")->trigger(); action("volumeUp")->trigger();
...@@ -620,9 +626,9 @@ static bool copyImage(QImage &dest, QImage &src, int x, int y) ...@@ -620,9 +626,9 @@ static bool copyImage(QImage &dest, QImage &src, int x, int y)
// However, we do have to specifically ensure that setAlphaBuffer is set // However, we do have to specifically ensure that setAlphaBuffer is set
// to false // to false
large_src.setAlphaBuffer(false); large_src.convertToFormat(QImage::Format_RGB32); // Turn off alpha
large_src.fill(0); // All transparent pixels large_src.fill(0); // All transparent pixels
large_src.setAlphaBuffer(true); large_src.convertToFormat(QImage::Format_ARGB32); // Turn on alpha
int w = src.width(); int w = src.width();
int h = src.height(); int h = src.height();
......
...@@ -227,11 +227,11 @@ Tag::Tag(const QString &fileName, bool) : ...@@ -227,11 +227,11 @@ Tag::Tag(const QString &fileName, bool) :
void Tag::setup(TagLib::File *file) void Tag::setup(TagLib::File *file)
{ {
m_title = TStringToQString(file->tag()->title()).stripWhiteSpace(); m_title = TStringToQString(file->tag()->title()).trimmed();
m_artist = TStringToQString(file->tag()->artist()).stripWhiteSpace(); m_artist = TStringToQString(file->tag()->artist()).trimmed();
m_album = TStringToQString(file->tag()->album()).stripWhiteSpace(); m_album = TStringToQString(file->tag()->album()).trimmed();
m_genre = TStringToQString(file->tag()->genre()).stripWhiteSpace(); m_genre = TStringToQString(file->tag()->genre()).trimmed();
m_comment = TStringToQString(file->tag()->comment()).stripWhiteSpace(); m_comment = TStringToQString(file->tag()->comment()).trimmed();
m_track = file->tag()->track(); m_track = file->tag()->track();
m_year = file->tag()->year(); m_year = file->tag()->year();
......
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#include <QToolTip> #include <QToolTip>
#include <qeventloop.h> #include <qeventloop.h>
#include <q3dict.h> #include <q3dict.h>
//Added by qt3to4:
#include <QEvent> #include <QEvent>
#include <QKeyEvent> #include <QKeyEvent>
#include <QHBoxLayout> #include <QHBoxLayout>
...@@ -59,7 +58,10 @@ class FileNameValidator : public QValidator ...@@ -59,7 +58,10 @@ class FileNameValidator : public QValidator
{ {
public: public:
FileNameValidator(QObject *parent, const char *name = 0) : FileNameValidator(QObject *parent, const char *name = 0) :
QValidator(parent, name) {} QValidator(parent)
{
setObjectName(name);
}
virtual void fixup(QString &s) const virtual void fixup(QString &s) const
{ {
...@@ -256,8 +258,8 @@ void TagEditor::slotRefresh() ...@@ -256,8 +258,8 @@ void TagEditor::slotRefresh()
m_bitrateBox->setText(QString::number(tag->bitrate())); m_bitrateBox->setText(QString::number(tag->bitrate()));
m_lengthBox->setText(tag->lengthString()); m_lengthBox->setText(tag->lengthString());
if(m_genreList.findIndex(tag->genre()) >= 0) if(m_genreList.indexOf(tag->genre()) >= 0)
m_genreBox->setCurrentIndex(m_genreList.findIndex(tag->genre()) + 1); m_genreBox->setCurrentIndex(m_genreList.indexOf(tag->genre()) + 1);
else { else {
m_genreBox->setCurrentIndex(0); m_genreBox->setCurrentIndex(0);
m_genreBox->setEditText(tag->genre()); m_genreBox->setEditText(tag->genre());
...@@ -453,7 +455,7 @@ void TagEditor::readConfig() ...@@ -453,7 +455,7 @@ void TagEditor::readConfig()
bool show = config.readEntry("Show", false); bool show = config.readEntry("Show", false);
ActionCollection::action<KToggleAction>("showEditor")->setChecked(show); ActionCollection::action<KToggleAction>("showEditor")->setChecked(show);
setShown(show); setVisible(show);
TagLib::StringList genres = TagLib::ID3v1::genreList(); TagLib::StringList genres = TagLib::ID3v1::genreList();
...@@ -686,10 +688,10 @@ void TagEditor::save(const PlaylistItemList &list) ...@@ -686,10 +688,10 @@ void TagEditor::save(const PlaylistItemList &list)
++it; ++it;
QString fileName = item->file().fileInfo().dirPath() + QDir::separator() + QString fileName = item->file().fileInfo().path() + QDir::separator() +
m_fileNameBox->text(); m_fileNameBox->text();
if(list.count() > 1) if(list.count() > 1)
fileName = item->file().fileInfo().absFilePath(); fileName = item->file().fileInfo().absoluteFilePath();
Tag *tag = TagTransactionManager::duplicateTag(item->file().tag(), fileName); Tag *tag = TagTransactionManager::duplicateTag(item->file().tag(), fileName);
...@@ -812,7 +814,7 @@ void TagEditor::showEvent(QShowEvent *e) ...@@ -812,7 +814,7 @@ void TagEditor::showEvent(QShowEvent *e)
bool TagEditor::eventFilter(QObject *watched, QEvent *e) bool TagEditor::eventFilter(QObject *watched, QEvent *e)
{ {
QKeyEvent *ke = static_cast<QKeyEvent*>(e); QKeyEvent *ke = static_cast<QKeyEvent*>(e);
if(watched->inherits("QSpinBox") && e->type() == QEvent::KeyRelease && ke->state() == 0) if(watched->inherits("QSpinBox") && e->type() == QEvent::KeyRelease && ke->modifiers() == 0)
slotDataChanged(); slotDataChanged();
return false; return false;
......
...@@ -102,7 +102,7 @@ QString FileNameScheme::composeRegExp(const QString &s) const ...@@ -102,7 +102,7 @@ QString FileNameScheme::composeRegExp(const QString &s) const
substitutions[ 'T' ] = config.readEntry("Track regexp", "(\\d+)"); substitutions[ 'T' ] = config.readEntry("Track regexp", "(\\d+)");
substitutions[ 'c' ] = config.readEntry("Comment regexp", "([\\w\\s_]+)"); substitutions[ 'c' ] = config.readEntry("Comment regexp", "([\\w\\s_]+)");
QString regExp = QRegExp::escape(s.simplifyWhiteSpace()); QString regExp = QRegExp::escape(s.simplified());
regExp = ".*" + regExp; regExp = ".*" + regExp;
regExp.replace(' ', "\\s+"); regExp.replace(' ', "\\s+");
regExp = KMacroExpander::expandMacros(regExp, substitutions); regExp = KMacroExpander::expandMacros(regExp, substitutions);
...@@ -186,11 +186,11 @@ void TagGuesser::guess(const QString &absFileName) ...@@ -186,11 +186,11 @@ void TagGuesser::guess(const QString &absFileName)
for (; it != end; ++it) { for (; it != end; ++it) {
const FileNameScheme schema(*it); const FileNameScheme schema(*it);
if(schema.matches(absFileName)) { if(schema.matches(absFileName)) {
m_title = capitalizeWords(schema.title().replace('_', " ")).stripWhiteSpace(); m_title = capitalizeWords(schema.title().replace('_', " ")).trimmed();
m_artist = capitalizeWords(schema.artist().replace('_', " ")).stripWhiteSpace(); m_artist = capitalizeWords(schema.artist().replace('_', " ")).trimmed();
m_album = capitalizeWords(schema.album().replace('_', " ")).stripWhiteSpace(); m_album = capitalizeWords(schema.album().replace('_', " ")).trimmed();
m_track = schema.track().stripWhiteSpace(); m_track = schema.track().trimmed();
m_comment = schema.comment().replace('_', " ").stripWhiteSpace(); m_comment = schema.comment().replace('_', " ").trimmed();
break; break;
} }
} }
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include <qtoolbutton.h> #include <qtoolbutton.h>
#include <qevent.h> #include <qevent.h>
//Added by qt3to4:
#include <QKeyEvent> #include <QKeyEvent>
TagGuesserConfigDlg::TagGuesserConfigDlg(QWidget *parent, const char *name) TagGuesserConfigDlg::TagGuesserConfigDlg(QWidget *parent, const char *name)
...@@ -37,8 +36,8 @@ TagGuesserConfigDlg::TagGuesserConfigDlg(QWidget *parent, const char *name) ...@@ -37,8 +36,8 @@ TagGuesserConfigDlg::TagGuesserConfigDlg(QWidget *parent, const char *name)
m_child->lvSchemes->setItemsRenameable(true); m_child->lvSchemes->setItemsRenameable(true);
m_child->lvSchemes->setSorting(-1); m_child->lvSchemes->setSorting(-1);
m_child->lvSchemes->setDefaultRenameAction(Q3ListView::Accept); m_child->lvSchemes->setDefaultRenameAction(Q3ListView::Accept);
m_child->bMoveUp->setIconSet(BarIconSet("1uparrow")); m_child->bMoveUp->setIcon(BarIconSet("1uparrow"));
m_child->bMoveDown->setIconSet(BarIconSet("1downarrow")); m_child->bMoveDown->setIcon(BarIconSet("1downarrow"));
const QStringList schemes = TagGuesser::schemeStrings(); const QStringList schemes = TagGuesser::schemeStrings();
QStringList::ConstIterator it = schemes.begin(); QStringList::ConstIterator it = schemes.begin();
...@@ -67,7 +66,7 @@ TagGuesserConfigDlg::TagGuesserConfigDlg(QWidget *parent, const char *name) ...@@ -67,7 +66,7 @@ TagGuesserConfigDlg::TagGuesserConfigDlg(QWidget *parent, const char *name)
void TagGuesserConfigDlg::accept() void TagGuesserConfigDlg::accept()
{ {
if(m_child->lvSchemes->renameLineEdit()) { if(m_child->lvSchemes->renameLineEdit()) {
QKeyEvent returnKeyPress(QEvent::KeyPress, Qt::Key_Return, 0, 0); QKeyEvent returnKeyPress(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier);
KApplication::sendEvent(m_child->lvSchemes->renameLineEdit(), &returnKeyPress); KApplication::sendEvent(m_child->lvSchemes->renameLineEdit(), &returnKeyPress);
} }
......
...@@ -123,14 +123,15 @@ bool TagTransactionManager::undo() ...@@ -123,14 +123,15 @@ bool TagTransactionManager::undo()
return result; return result;
} }
TagTransactionManager::TagTransactionManager(QWidget *parent) : QObject(parent, "tagmanager") TagTransactionManager::TagTransactionManager(QWidget *parent) : QObject(parent)
{ {
setObjectName("tagmanager");
m_manager = this; m_manager = this;
} }
bool TagTransactionManager::renameFile(const QFileInfo &from, const QFileInfo &to) const bool TagTransactionManager::renameFile(const QFileInfo &from, const QFileInfo &to) const
{ {
if(!QFileInfo(to.dirPath()).isWritable() || !from.exists()) if(!QFileInfo(to.path()).isWritable() || !from.exists())
return false; return false;
if(!to.exists() || if(!to.exists() ||
...@@ -139,9 +140,9 @@ bool TagTransactionManager::renameFile(const QFileInfo &from, const QFileInfo &t ...@@ -139,9 +140,9 @@ bool TagTransactionManager::renameFile(const QFileInfo &from, const QFileInfo &t
i18n("This file already exists.\nDo you want to replace it?"), i18n("This file already exists.\nDo you want to replace it?"),
i18n("File Exists"),KGuiItem(i18n("Replace"))) == KMessageBox::Continue) i18n("File Exists"),KGuiItem(i18n("Replace"))) == KMessageBox::Continue)
{ {
kDebug(65432) << "Renaming " << from.absFilePath() << " to " << to.absFilePath() << endl; kDebug(65432) << "Renaming " << from.absoluteFilePath() << " to " << to.absoluteFilePath() << endl;
QDir currentDir; QDir currentDir;
return currentDir.rename(from.absFilePath(), to.absFilePath()); return currentDir.rename(from.absoluteFilePath(), to.absoluteFilePath());
} }
return false; return false;
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include <QFile> #include <QFile>
#include <QDir> #include <QDir>
#include <QDataStream> #include <QDataStream>
//Added by qt3to4:
#include <Q3ValueList> #include <Q3ValueList>
#include <QResizeEvent> #include <QResizeEvent>
#include <QEvent> #include <QEvent>
...@@ -196,7 +195,7 @@ QStringList ViewMode::lines(const PlaylistBox::Item *item, ...@@ -196,7 +195,7 @@ QStringList ViewMode::lines(const PlaylistBox::Item *item,
while(!line.isEmpty()) { while(!line.isEmpty()) {
int textLength = line.length(); int textLength = line.length();
while(textLength > 0 && while(textLength > 0 &&
fm.width(line.mid(0, textLength).stripWhiteSpace()) + fm.width(line.mid(0, textLength).trimmed()) +
item->listView()->itemMargin() * 2 > width) item->listView()->itemMargin() * 2 > width)
{ {
int i = line.lastIndexOf(QRegExp( "\\W"), textLength - 1); int i = line.lastIndexOf(QRegExp( "\\W"), textLength - 1);
...@@ -206,7 +205,7 @@ QStringList ViewMode::lines(const PlaylistBox::Item *item, ...@@ -206,7 +205,7 @@ QStringList ViewMode::lines(const PlaylistBox::Item *item,
textLength--; textLength--;
} }
l.append(line.mid(0, textLength).stripWhiteSpace()); l.append(line.mid(0, textLength).trimmed());
line = line.mid(textLength); line = line.mid(textLength);
} }
return l; return l;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment