Commit f7b5a5c0 authored by Scott Wheeler's avatar Scott Wheeler

JuK currently requires a recent kdelibs from HEAD so I'm removing the left

over hacks to make it work with 3.1 libs.

svn path=/trunk/kdemultimedia/juk/; revision=240929
parent 3f6e44c3
......@@ -12,9 +12,7 @@
#include <kapplication.h>
#include <kconfig.h>
#include <kdebug.h>
#if KDE_IS_VERSION(3,1,90)
# include <kmacroexpander.h>
#endif
#include <kmacroexpander.h>
#include <qdir.h>
......@@ -72,14 +70,7 @@ void FileRenamer::rename(const PlaylistItem *item)
substitutions[ 'T' ] = trackToken;
substitutions[ 'c' ] = commentToken;
#if KDE_IS_VERSION(3,1,90)
newFilename = KMacroExpander::expandMacros(newFilename, substitutions);
#else
QMap<QChar, QString>::ConstIterator it = substitutions.begin();
QMap<QChar, QString>::ConstIterator end = substitutions.end();
for(; it != end; ++it)
newFilename.replace("%" + QString(it.key()), it.data());
#endif
newFilename = newFilename.stripWhiteSpace();
......
......@@ -19,11 +19,7 @@
#define KEYDIALOG_H
#include <kdeversion.h>
#if KDE_IS_VERSION(3,1,90)
# include <kactioncollection.h>
#else
# include <kaction.h>
#endif
#include <kactioncollection.h>
#include <kdialogbase.h>
#include <kglobalaccel.h>
#include <kkeydialog.h>
......
......@@ -31,23 +31,6 @@ static const char stephan[] = I18N_NOOP("Track announcement popups");
static const char frerich[] = I18N_NOOP("Automagic track data guessing, bugfixes");
static const char zack[] = I18N_NOOP("More automagical things, now using MusicBrainz");
#if KDE_IS_VERSION(3,1,90)
typedef KUniqueApplication Application;
#else
class Application : public KUniqueApplication
{
public:
Application() : KUniqueApplication(true, true, false) {}
virtual ~Application() {}
virtual int newInstance() {
QWidget *w = mainWidget();
if(w)
w->setShown(true);
return KUniqueApplication::newInstance();
}
};
#endif
static KCmdLineOptions options[] =
{
#ifndef NO_DEBUG
......@@ -74,9 +57,9 @@ int main(int argc, char *argv[])
KCmdLineArgs::init(argc, argv, &aboutData);
KCmdLineArgs::addCmdLineOptions(options);
Application::addCmdLineOptions();
KUniqueApplication::addCmdLineOptions();
Application a;
KUniqueApplication a;
// Here we do some DCOP locking of sorts to prevent incoming DCOP calls
// before JuK has finished its initialization.
......
......@@ -48,11 +48,7 @@ MusicBrainzQuery::MusicBrainzQuery(QueryType query, const QStringList &args,
void MusicBrainzQuery::start()
{
if(m_query == File) {
#if KDE_IS_VERSION(3,1,90)
KProcess *process = new KProcess(this);
#else
KProcess *process = new KProcess;
#endif
*process << "trm";
*process << m_arguments.first();
......
......@@ -287,13 +287,8 @@ void PlaylistBox::deleteItems(const ItemList &items)
}
if(!files.isEmpty()) {
#if 0
int remove = KMessageBox::warningYesNoCancelList(
this, i18n("Do you want to delete these files from the disk as well?"), files);
#else
int remove = KMessageBox::warningYesNoCancel(
this, i18n("Do you want to delete these files from the disk as well?"));
#endif
if(remove == KMessageBox::Yes) {
QStringList couldNotDelete;
......
......@@ -11,9 +11,7 @@
#include <kapplication.h>
#include <kconfig.h>
#include <kdebug.h>
#if KDE_IS_VERSION(3,1,90)
# include <kmacroexpander.h>
#endif
#include <kmacroexpander.h>
FileNameScheme::FileNameScheme(const QString &s)
......@@ -104,14 +102,7 @@ QString FileNameScheme::composeRegExp(const QString &s) const
QString regExp = QRegExp::escape(s.simplifyWhiteSpace());
regExp = ".*" + regExp;
regExp.replace(' ', "\\s+");
#if KDE_IS_VERSION(3,1,90)
regExp = KMacroExpander::expandMacros(regExp, substitutions);
#else
QMap<QChar, QString>::ConstIterator it = substitutions.begin();
QMap<QChar, QString>::ConstIterator end = substitutions.end();
for (; it != end; ++it)
regExp.replace("%" + QString(it.key()), it.data());
#endif
regExp += ".*";
return regExp;
}
......
......@@ -143,28 +143,6 @@ void CompactViewMode::paintCell(PlaylistBox::Item *item,
const QColorGroup &colorGroup,
int column, int width, int align)
{
#if 0 // don't think this code is needed anymore
if(width < item->pixmap(column)->width())
return;
QFontMetrics fm = painter->fontMetrics();
QString line = item->text();
int baseWidth = item->pixmap(column)->width() + item->listView()->itemMargin() * 4;
if(baseWidth + fm.width(line) > width) {
int ellipsisLength = fm.width("...");
if(width > baseWidth + ellipsisLength) {
while(baseWidth + fm.width(line) + ellipsisLength > width)
line.truncate(line.length() - 1);
line = line.append("...");
}
else
line = "...";
}
item->KListViewItem::setText(column, line);
#endif
item->KListViewItem::paintCell(painter, colorGroup, column, width, align);
}
......
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