For now, deny the usage of the "unrar-free", as it does not seem to be much usable... svn path=/trunk/KDE/kdegraphics/okular/; revision=754056remotes/origin/KDE/4.0
parent
24e03633fc
commit
3c64c3232a
6 changed files with 187 additions and 1 deletions
@ -0,0 +1,73 @@ |
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 by Pino Toscano <pino@kde.org> * |
||||||
|
* * |
||||||
|
* This program is free software; you can redistribute it and/or modify * |
||||||
|
* it under the terms of the GNU General Public License as published by * |
||||||
|
* the Free Software Foundation; either version 2 of the License, or * |
||||||
|
* (at your option) any later version. * |
||||||
|
***************************************************************************/ |
||||||
|
|
||||||
|
#include "unrarflavours.h" |
||||||
|
|
||||||
|
#include <QtCore/QRegExp> |
||||||
|
#include <QtCore/QStringList> |
||||||
|
|
||||||
|
UnrarFlavour::UnrarFlavour() |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
UnrarFlavour::~UnrarFlavour() |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
void UnrarFlavour::setFileName( const QString &fileName ) |
||||||
|
{ |
||||||
|
mFileName = fileName; |
||||||
|
} |
||||||
|
|
||||||
|
QString UnrarFlavour::fileName() const |
||||||
|
{ |
||||||
|
return mFileName; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
NonFreeUnrarFlavour::NonFreeUnrarFlavour() |
||||||
|
: UnrarFlavour() |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
QStringList NonFreeUnrarFlavour::processListing( const QStringList &data ) |
||||||
|
{ |
||||||
|
// unrar-nonfree just lists the files
|
||||||
|
return data; |
||||||
|
} |
||||||
|
|
||||||
|
QString NonFreeUnrarFlavour::name() const |
||||||
|
{ |
||||||
|
return "unrar-nonfree"; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
FreeUnrarFlavour::FreeUnrarFlavour() |
||||||
|
: UnrarFlavour() |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
QStringList FreeUnrarFlavour::processListing( const QStringList &data ) |
||||||
|
{ |
||||||
|
QRegExp re( "^ ([^/]+/([^\\s]+))$" ); |
||||||
|
|
||||||
|
QStringList newdata; |
||||||
|
foreach ( const QString &line, data ) |
||||||
|
{ |
||||||
|
if ( re.exactMatch( line ) ) |
||||||
|
newdata.append( re.cap( 1 ) ); |
||||||
|
} |
||||||
|
return newdata; |
||||||
|
} |
||||||
|
|
||||||
|
QString FreeUnrarFlavour::name() const |
||||||
|
{ |
||||||
|
return "unrar-free"; |
||||||
|
} |
||||||
|
|
||||||
@ -0,0 +1,55 @@ |
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 by Pino Toscano <pino@kde.org> * |
||||||
|
* * |
||||||
|
* This program is free software; you can redistribute it and/or modify * |
||||||
|
* it under the terms of the GNU General Public License as published by * |
||||||
|
* the Free Software Foundation; either version 2 of the License, or * |
||||||
|
* (at your option) any later version. * |
||||||
|
***************************************************************************/ |
||||||
|
|
||||||
|
#ifndef UNRARFLAVOURS_H |
||||||
|
#define UNRARFLAVOURS_H |
||||||
|
|
||||||
|
#include <QtCore/QString> |
||||||
|
|
||||||
|
class QStringList; |
||||||
|
|
||||||
|
class UnrarFlavour |
||||||
|
{ |
||||||
|
public: |
||||||
|
virtual ~UnrarFlavour(); |
||||||
|
|
||||||
|
virtual QStringList processListing( const QStringList &data ) = 0; |
||||||
|
virtual QString name() const = 0; |
||||||
|
|
||||||
|
void setFileName( const QString &fileName ); |
||||||
|
|
||||||
|
protected: |
||||||
|
UnrarFlavour(); |
||||||
|
|
||||||
|
QString fileName() const; |
||||||
|
|
||||||
|
private: |
||||||
|
QString mFileName; |
||||||
|
}; |
||||||
|
|
||||||
|
class NonFreeUnrarFlavour : public UnrarFlavour |
||||||
|
{ |
||||||
|
public: |
||||||
|
NonFreeUnrarFlavour(); |
||||||
|
|
||||||
|
virtual QStringList processListing( const QStringList &data ); |
||||||
|
virtual QString name() const; |
||||||
|
}; |
||||||
|
|
||||||
|
class FreeUnrarFlavour : public UnrarFlavour |
||||||
|
{ |
||||||
|
public: |
||||||
|
FreeUnrarFlavour(); |
||||||
|
|
||||||
|
virtual QStringList processListing( const QStringList &data ); |
||||||
|
virtual QString name() const; |
||||||
|
}; |
||||||
|
|
||||||
|
#endif |
||||||
|
|
||||||
Loading…
Reference in new issue