Commit a381d801 authored by Shie Erlich's avatar Shie Erlich
Browse files

add: isArchive to check if a url is pointing to an archive

parent fd60a654
......@@ -42,6 +42,8 @@
#include "../defaults.h"
#include "../krservices.h"
static QStringList arcProtocols = QStringList::split(";", "tar;bzip;bzip2;gzip;krarc;zip");
QStringList KRarcHandler::supportedPackers() {
QStringList packers;
......@@ -410,4 +412,12 @@ void KRarcHandler::setPassword( KProcess * proc, char *buffer, int ) {
} else password = QString::null;
}
bool KRarcHandler::isArchive(const KURL& url) {
QString protocol = url.protocol();
if (arcProtocols.find(protocol) != arcProtocols.end())
return true;
else return false;
}
#include "krarchandler.moc"
......@@ -33,6 +33,7 @@
#include <qstringlist.h>
#include <qobject.h>
#include <kprocess.h>
#include <kurl.h>
class KRarcHandler: public QObject {
Q_OBJECT
......@@ -53,6 +54,8 @@ public:
static QStringList supportedPackers();
// removes the alias names for a packer
static void removeAliases( QString &type );
// true - if the url is an archive (ie: tar:/home/test/file.tar.bz2)
static bool isArchive(const KURL& url);
// used to store the current archive password
QString password;
int inSet;
......
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