diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-02-10 15:10:13 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-02-13 11:44:42 +0900 |
commit | 8f8f84410cc591c85c5e83e0b3efdcda5fdbe42e (patch) | |
tree | f273a932ce048ef22ea9d9888b77ea8a2b8f3e33 /src/sq_archivehandler.h | |
parent | 424635023ee423826de12514b2fec7834b8deb7b (diff) | |
download | ksquirrel-8f8f8441.tar.gz ksquirrel-8f8f8441.zip |
Rename 'ksquirrel' folder to 'src'
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 203fcb8d90752b546c672c625927a136b959fcfb)
Diffstat (limited to 'src/sq_archivehandler.h')
-rw-r--r-- | src/sq_archivehandler.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/sq_archivehandler.h b/src/sq_archivehandler.h new file mode 100644 index 0000000..bc46a48 --- /dev/null +++ b/src/sq_archivehandler.h @@ -0,0 +1,67 @@ +/*************************************************************************** + sq_archivehandler.h - description + ------------------- + begin : ??? ??? 26 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +#ifndef SQ_ARCHIVEHANDLER_H +#define SQ_ARCHIVEHANDLER_H + +#include <tqobject.h> +#include <tqstring.h> +#include <tqmap.h> + +// forward declarations +class KFileItem; +class KURL; + +#define SQ_AH SQ_ArchiveHandler + +/* + * Helper class for archive extracting via tdeio-slaves (since 0.7.1). + */ + +class SQ_ArchiveHandler : public TQObject, TQMap<TQString, TQString> +{ + TQ_OBJECT + + + public: + SQ_ArchiveHandler(TQObject *parent = 0, const char *name = 0); + ~SQ_ArchiveHandler(); + + /* + * Find protocol name by mimetype name. + * + * For example findProtocolByMime(""application/x-tgz"") will + * return "tar". + */ + TQString findProtocolByMime(const TQString &mime); + + /* + * Find protocol name by KFileItem's mimetype. + */ + TQString findProtocolByFile(KFileItem *item); + + /* + * Determine mimetype and emit unpack() signal + */ + void tryUnpack(KFileItem *); + + void tryUnpack(const KURL &, const TQString &mime); + + static SQ_ArchiveHandler* instance() { return m_instance; } + + private: + void fillProtocols(); + + signals: + void unpack(const KURL &); + + private: + static SQ_ArchiveHandler *m_instance; +}; + +#endif |