Namespace sh::tools¶
-
namespace
sh
::
tools
Auxiliary stuff.
-
class
AtomicCounter
- #include <atomiccounter.h>
Internal tool for reference counting.
Public Functions
-
AtomicCounter
()
-
int
value
()
-
std::shared_ptr<AtomicCounter::Increment>
increment
()
-
int
doIncValue
()
-
int
doDecValue
()
Private Members
-
int
_value
= 0
-
QMutex
_mutex
-
class
Increment
- #include <atomiccounter.h>
Private Members
-
AtomicCounter *
_ac
Friends
- friend class AtomicCounter
-
AtomicCounter *
-
-
class
Benchmarking
: public QObject, public sh::base::Singleton - #include <benchmarking.h>
Tools for performance measurements.
Public Types
-
typedef QPair<QString, qint64>
BenchmarkFrame
A pair of a benchmark keyname and a duration value.
Public Functions
-
Benchmarking
()
-
void
shutdown
() Shutdown down this singleton.
-
bool
isAlive
() Returns if this singleton is alive (true until its shutdown begins).
-
typedef QPair<QString, qint64>
-
class
Bookmark
- #include <bookmarkmanager.h>
A bookmark.
Public Functions
Constructed only by the infrastructure and made available otherwise.
-
QString
id
() The bookmark id (used in some methods of sh::tools::BookmarkManager).
-
QList<QString>
folder
() The bookmark folder (the user interface calls it ‘Collections’).
-
QString
label
() The bookmark label.
-
std::shared_ptr<const sh::filesystem::Eurl>
eurl
() The location this bookmark points to.
Internal information for bookkeeping.
Can be used by external code for keeping track of dynamically created bookmarks.
Private Members
-
QString
_id
-
QStringList
_folder
-
QString
_label
-
std::shared_ptr<const sh::filesystem::Eurl>
_eurl
-
class
BookmarkManager
: public QObject, public sh::base::Singleton - #include <bookmarkmanager.h>
The bookmark manager.
Use it for getting or modifying bookmarks.
Public Functions
-
bool
hasBookmarks
() Checks if any bookmarks exist.
Adds a new bookmark.
- Return
The id of the new bookmark.
-
void
removeBookmark
(QString id) Removes a bookmarks.
Changes data of a bookmark.
-
void
changeBookmarkTags
(QString id, QString tags) Changes the
tags
of a bookmark.
-
void
moveBookmarkUp
(QString id) Moves a bookmark up within its folder.
-
void
moveBookmarkDown
(QString id) Moves a bookmark down within its folder.
-
void
moveBookmarkToFolder
(QString id, QList<QString> folder) Changes to
folder
of a bookmark.
-
void
doInitialize
() Executes singleton initialization.
-
void
doShutdown
() Executes singleton shutdown.
-
void
shutdown
() Shutdown down this singleton.
-
bool
isAlive
() Returns if this singleton is alive (true until its shutdown begins).
Signals
-
void
changed
()
Private Functions
-
BookmarkManager
()
-
void
moveBookmark
(QString id, int direction)
-
void
readBookmarks
()
-
void
writeBookmarks
()
Private Members
-
std::shared_ptr<sh::configuration::ConfigurationValue>
cfgvalBookmarks
-
QList<std::shared_ptr<Bookmark>>
_bookmarks
-
QMutex
_bookmarksmutex
-
bool
-
class
DataExchange
: public QObject, public sh::base::Singleton - #include <dataexchange.h>
Clipboard and DnD related tools.
Public Types
-
enum
DataExchangeType
A kind of data exchange movement.
Values:
-
enumerator
COPY
-
enumerator
MOVE
-
enumerator
Public Functions
-
bool
containsFileEntries
(const QMimeData*) Checks if a QMimeData contains any file entries we understand.
Returns a new QMimeData for a list of filesystem nodes and an exchange type.
Returns a copy action for a source by QMimeData and a destination eurl.
Returns a move action for a source by QMimeData and a destination eurl.
Returns a paste action for a source by QMimeData and a destination eurl (copy or move by QMimeData).
-
QList<std::shared_ptr<const sh::filesystem::Eurl>>
getSources
(const QMimeData *src, bool *isCut = 0) Returns a list of eurls (and if it is a cut/move exchange) from the QMimeData.
-
void
doInitialize
() Executes singleton initialization.
-
void
doShutdown
() Executes singleton shutdown.
-
void
shutdown
() Shutdown down this singleton.
-
bool
isAlive
() Returns if this singleton is alive (true until its shutdown begins).
Public Static Attributes
-
QString
FilelistTypeShallot
= "x-special/shallot-copied-files"
-
QString
FilelistTypeGnome
= "x-special/gnome-copied-files"
-
QString
FilelistTypeUrilist
= "text/uri-list"
-
QString
FilelistTypePlaintext
= "text/plain"
Private Functions
-
DataExchange
()
Private Static Attributes
-
QString
linebreak
= "\n"
-
enum
-
template<class
T
>
classHistoryTracker
- #include <historytracker.h>
A data structure for tracking a history of data.
It is a templated container It is typically used for tracking the directory history (used by sh::actions::common::ActionHistoryNavigate, et al).
Public Functions
-
HistoryTracker
()
-
void
visitValue
(T v)
-
int
count
()
-
QList<HistoryEntry>
forwardList
()
-
QList<HistoryEntry>
backwardList
()
-
void
revisitValue
(int idx)
Public Members
-
const int
HISTORY_SIZE
= 10
-
class
HistoryEntry
- #include <historytracker.h>
-
-
class
Jsonable
- #include <misc.h>
An interface for objects which can return a json representation as QJsonObject.
Subclassed by sh::ui::web::WebDialog, sh::ui::web::WebFilePropertyDialog::WebFilePropertyDialogTabActionsView, sh::ui::web::WebFilePropertyDialog::WebFilePropertyDialogTabIconTextBannerView, sh::ui::web::WebFilePropertyDialog::WebFilePropertyDialogTabTableView, sh::ui::web::WebFilePropertyDialog::WebFilePropertyDialogTabTextView
Public Functions
-
QJsonObject
toJson
() = 0 Returns the json respesentation as QJsonObject.
-
QJsonObject
-
class
LocalFile
: public QFile - #include <datastream.h>
A QFile (and a QIODevice) for local file access.
It also stores the information whether this is a temporary location or the permanent one.
Public Functions
-
LocalFile
(QString &file, bool isTemp = false)
-
bool
isTemp
()
Private Members
-
bool
_istemp
-
-
class
LocalFilesystemWatcher
: public QObject, public sh::base::Singleton - #include <localfilesystemwatcher.h>
Used for watching parts of the local filesystem.
Depending on the compile flags and your system, this functionality might not be available. If so, the methods are no-ops.
Public Functions
-
qint64
addFile
(QString path) Watches one more file.
See also removeFile().
-
void
removeFile
(qint64 id) Stops watching a file (by the return value of
addFile()
).
-
qint64
addDirectory
(QString path) Watches one more directory.
See also removeDirectory().
-
void
removeDirectory
(qint64 id) Stops watching a directory (by the return value of
addDirectory()
).
-
~LocalFilesystemWatcher
()
-
void
doInitialize
() Executes singleton initialization.
-
void
doShutdown
() Executes singleton shutdown.
-
void
shutdown
() Shutdown down this singleton.
-
bool
isAlive
() Returns if this singleton is alive (true until its shutdown begins).
Signals
-
void
elementModified
(QString name, QList<qint64> ids)
-
void
elementDeleted
(QString name, QList<qint64> ids)
-
void
elementCreated
(QString name, QList<qint64> ids)
Private Functions
-
LocalFilesystemWatcher
()
-
void
emitElementModified
(QString name, QList<qint64> ids)
-
void
emitElementDeleted
(QString name, QList<qint64> ids)
-
void
emitElementCreated
(QString name, QList<qint64> ids)
Private Members
-
InotifyThread *
inotifyThread
-
QMutex
inotifymutex
-
QHash<int, QList<qint64>>
inotifywd2ids
-
QHash<qint64, int>
id2inotifywd
-
QHash<qint64, QString>
id2path
-
qint64
nextEid
= 0
-
QMutex
inotifythreadmutex
-
QWaitCondition
inotifythreadmutexwait
Friends
- friend class InotifyThread
-
class
InotifyThread
: public QThread Public Functions
-
InotifyThread
(LocalFilesystemWatcher *watcher)
Friends
- friend class LocalFilesystemWatcher
-
-
qint64
-
class
LocalFilesystemWatcherConnector
: public QObject, public sh::base::Singleton - #include <localfilesystemwatcherconnector.h>
Observes the list of file views via VisibleViews and controls LocalFilesystemWatcher with that for observing the filesystem for changes.
Public Functions
-
void
doInitialize
() Executes singleton initialization.
-
void
doShutdown
() Executes singleton shutdown.
-
void
shutdown
() Shutdown down this singleton.
-
bool
isAlive
() Returns if this singleton is alive (true until its shutdown begins).
Private Functions
-
LocalFilesystemWatcherConnector
()
Private Members
-
QHash<std::shared_ptr<const sh::filesystem::Eurl>, QList<qint64>>
dir2watcherids
-
QHash<qint64, std::shared_ptr<const sh::filesystem::Eurl>>
watcherid2dir
-
void
-
class
Misc
- #include <misc.h>
Public Static Functions
-
QByteArray
iconToPngByteArray
(QIcon icon, int sizeInPt) Computes a png representation for an icon.
-
QByteArray
iconToBase64SrcEncoding
(QIcon icon, int sizeInPt) Computes a html-compatible ‘data:image/png;base64,…’ png representation for an icon.
-
QByteArray
hash
(QStringList data) Hashes string data in a cryptographical way (with a salt).
Use with compareHash().
-
QByteArray
hashUnsalted
(QStringList data) Hashes string data in a cryptographical way without a salt.
Use with compareHash() or just compare strings.
-
bool
compareHash
(QByteArray hash, QStringList data) Check if a hash is matching to given string data.
-
QByteArray
qjsonToJson
(QJsonObject o) Returns a json string for a QJsonObject, QJsonValue or QJsonArray.
-
QByteArray
qjsonToJson
(QJsonValue o)
-
QByteArray
qjsonToJson
(QJsonArray a)
-
QByteArray
qmapToJson
(QVariantMap m) Returns a json string for a QVariantMap.
-
QByteArray
randomBytes
(int length = 32) Returns a random byte array.
-
QByteArray
generateUniqueHash
() Returns a (mostly) random generated unique hash.
-
void
makeHttpRequest
(QUrl url, QByteArray *responseBody = nullptr, QString *mimeType = nullptr, int *httpStatus = nullptr) Makes an http request (as a client).
httpStatus
can return0
for network errors and similar.
Private Functions
-
Misc
()
Private Static Functions
-
QByteArray
_hash
(QStringList data, bool salted, QByteArray _withSalt)
Private Static Attributes
-
QByteArray
_jundefined
-
QNetworkAccessManager
_qnetwork
-
QByteArray
-
class
OperationsCache
: public QObject, public sh::base::Singleton - #include <operationscache.h>
A cached factory for readonly sh::filesystem::Operation instances.
You can use it for fetching an sh::filesystem::Operation for a certain sh::filesystem::Eurl. Two restrictions apply:
Data might be slightly outdated.
Just for read-only access.
Public Functions
Returns a cached sh::filesystem::Operation for a container (by eurl).
-
void
doInitialize
() Executes singleton initialization.
-
void
doShutdown
() Executes singleton shutdown.
-
void
shutdown
() Shutdown down this singleton.
-
bool
isAlive
() Returns if this singleton is alive (true until its shutdown begins).
Private Functions
-
OperationsCache
()
Private Members
-
QHash<std::shared_ptr<const sh::filesystem::Eurl>, std::shared_ptr<sh::filesystem::Operation>>
cache
-
QMutex
cachemutex
-
class
ReadDataDevice
: public QIODevice - #include <datastream.h>
A QIODevice implementation, acting as an abstract base class for other subclasses.
The provided interface is not as generic but easier than the original one for many easier tasks.
Subclassed by sh::scripting::api::ApiReadDataDevice
Public Functions
-
ReadDataDevice
()
-
QByteArray
getdata
() = 0 This method returns the next available chunk of data. It may return empty arrays whenever temporarily no data is available. Returning a null array (with
QByteArray::isNull()==true
) marks the end of the stream. .
Private Members
-
QByteArray
current
-
int
currentlen
= 0
-
int
currentconsumed
= 0
-
-
class
ThumbnailManager
: public QObject, public sh::base::Singleton - #include <thumbnailmanager.h>
Creates thumbnail images for filesystem nodes.
This is a cached source.
Public Functions
Requests a thumbnail in a given size for a given node.
- Parameters
callback
: Called when the thumbnail is ready.
Returns a thumbnail in a given size for a given node from the current cache.
-
void
invalidateCache
() Invalidates the thumbnail cache.
Adds a thumbnail provider.
-
void
doInitialize
() Executes singleton initialization.
-
void
shutdown
() Shutdown down this singleton.
-
bool
isAlive
() Returns if this singleton is alive (true until its shutdown begins).
Signals
Emitted when a new thumbnail is available.
Public Static Attributes
-
const int
REGISTER_THUMBNAILPROVIDER_INDEX_CORE
= 1000000 Base value for display indexes of core (i.e. very important) thumbnail providers.
Used in ThumbnailProvider::addThumbnailProvider.
-
const int
REGISTER_THUMBNAILPROVIDER_INDEX_NORMAL
= 2000000 Base value for display indexes of thumbnail providers with normal importance.
Used in ThumbnailProvider::addThumbnailProvider.
-
const int
REGISTER_THUMBNAILPROVIDER_INDEX_EXOTIC
= 3000000 Base value for display indexes of exotic thumbnail providers.
Used in ThumbnailProvider::addThumbnailProvider.
-
const int
REGISTER_THUMBNAILPROVIDER_INDEX_FALLBACK
= 4000000 Base value for display indexes of fallback thumbnail providers (those who try to get something when everything else failed).
Used in ThumbnailProvider::addThumbnailProvider.
Private Functions
-
ThumbnailManager
()
-
void
worker
()
-
void
_enforce_capacity
()
Private Members
-
QHash<sh::filesystem::FilesystemNode*, Thumbnail*>
thumbnails
-
QMutex
thumbnailslock
-
QList<ThumbnailRequest>
requestQueue
-
int
maxworkers
-
int
runningworkers
-
QMutex
workermutex
-
int
capacity
-
qint64
_curr_accessTime
= 0
-
QHash<int, std::shared_ptr<ThumbnailProvider>>
_thumbnailProviderMap
-
QList<std::shared_ptr<ThumbnailProvider>>
_thumbnailProviders
-
QMutex
_thumbnailProvidersMutex
-
class
Thumbnail
Public Functions
-
Thumbnail
(QIcon icon, qint64 validUntil, qint64 accessTime, std::weak_ptr<sh::filesystem::FilesystemNode> node, int width, int height)
Public Members
-
QIcon
icon
-
qint64
validUntil
-
qint64
accessTime
-
bool
refreshRequested
-
std::weak_ptr<sh::filesystem::FilesystemNode>
node
-
int
width
-
int
height
-
-
class
ThumbnailRequest
Public Functions
-
ThumbnailRequest
(std::weak_ptr<sh::filesystem::FilesystemNode> node, int width, int height, QList<std::function<void(QIcon)>> callbacks)
-
bool
operator==
(ThumbnailRequest const &b)
Public Members
-
std::weak_ptr<sh::filesystem::FilesystemNode>
node
-
int
width
-
int
height
-
QList<std::function<void(QIcon)>>
callbacks
-
-
class
ThumbnailSortStruct
Public Functions
-
ThumbnailSortStruct
(sh::filesystem::FilesystemNode *node, qint64 accessTime)
-
-
class
ThumbnailProvider
- #include <thumbnailmanager.h>
Subclassed by sh::scripting::api::ApiThumbnailProvider, sh::tools::thumbnailproviders::DefaultImageThumbnailProvider, sh::tools::thumbnailproviders::FfmpegVideoThumbnailProvider, sh::tools::thumbnailproviders::ImageMagickPdfThumbnailProvider, sh::tools::thumbnailproviders::PlaintextThumbnailProvider
Public Functions
-
class
UserDirLock
- #include <userdirlock.h>
Locks the Shallot user directory during exclusive usage.
This lock is rather heavy-weight and should be used only if necessary!
Public Functions
-
UserDirLock
() Is intended to be directly constructed from everywhere.
-
~UserDirLock
()
Private Members
-
bool
dounlock
-
QString
slockpref
-
QString
slockfile
Private Static Attributes
-
QThread *
currentThread
= 0
-
QMutex
mutex
-
-
class
VisibleViews
: public sh::base::Singleton - #include <visibleviews.h>
Used for keeping track of which fileviews show which directories.
Whenever the view goes to other directories, this manager gets notified and redirects the notification to some other parts of the program.
Public Functions
Called when a view enters the given directory node. .
Registers a function to be called whenever the view just entered the given directory node.
Registers a function to be called whenever the view just left the given directory node.
-
void
doInitialize
() Executes singleton initialization.
-
void
doShutdown
() Executes singleton shutdown.
-
void
shutdown
() Shutdown down this singleton.
-
bool
isAlive
() Returns if this singleton is alive (true until its shutdown begins).
Private Functions
-
VisibleViews
()
Private Members
-
QHash<std::shared_ptr<sh::filesystem::FilesystemNode>, int>
visibleDirs
-
QList<std::function<void(std::shared_ptr<sh::filesystem::FilesystemNode>)>>
onenteredhandlers
-
QList<std::function<void(std::shared_ptr<sh::filesystem::FilesystemNode>)>>
onlefthandlers
-
namespace
accounts
Account and password storage.
See sh::tools::accounts::AccountsManager for more.
-
class
AbstractAccountsProvider
- #include <abstractaccountsprovider.h>
Abstract base class for accounts provider.
Implement this class (and register an instance of it) in order to add support for something like a password/account manager.
Subclassed by sh::tools::accounts::FallbackAccountsProvider, sh::tools::accounts::LibsecretAccountsProvider
Public Functions
-
AbstractAccountsProvider
()
-
~AbstractAccountsProvider
()
Finds account info by a given pattern.
Stores account infos.
-
-
class
Account
- #include <accountsmanager.h>
Account data (for accessing network drives).
Public Members
-
QString
username
-
QString
domain
-
QString
server
-
int
serverport
= -1
-
QString
path
-
QString
protocol
-
QString
authtype
-
QByteArray
authinfo
-
QString
-
class
AccountsManager
: public sh::base::Singleton - #include <accountsmanager.h>
Storage for account data (for accessing network drives).
Public Functions
Finds account infos by a given pattern.
Stores account infos.
Registers a new accounts provider.
-
void
doInitialize
() Executes singleton initialization.
-
void
doShutdown
() Executes singleton shutdown.
-
void
shutdown
() Shutdown down this singleton.
-
bool
isAlive
() Returns if this singleton is alive (true until its shutdown begins).
Private Functions
-
AccountsManager
()
-
class
FallbackAccountsProvider
: public sh::tools::accounts::AbstractAccountsProvider - #include <fallbackaccountsprovider.h>
A fallback accounts provider which at least stores user names (i.e. no passwords) locally on disk.
Public Functions
-
FallbackAccountsProvider
()
Finds account info by a given pattern.
Stores account infos.
Public Static Functions
-
void
doInitialize
()
-
void
doShutdown
()
Private Functions
Private Members
-
QString
accountsdir
-
-
class
LibsecretAccountsProvider
: public sh::tools::accounts::AbstractAccountsProvider - #include <libsecretaccountsprovider.h>
An accounts provider based on gnome-keyring.
Public Functions
-
LibsecretAccountsProvider
()
Finds account info by a given pattern.
Stores account infos.
Public Static Functions
-
void
doInitialize
()
-
void
doShutdown
()
Private Members
-
QByteArray
sauthtype
= QString("authtype").toUtf8()
-
QByteArray
sdomain
= QString("domain").toUtf8()
-
QByteArray
spath
= QString("object").toUtf8()
-
QByteArray
sprotocol
= QString("protocol").toUtf8()
-
QByteArray
sserver
= QString("server").toUtf8()
-
QByteArray
sserverport
= QString("port").toUtf8()
-
QByteArray
susername
= QString("user").toUtf8()
-
-
class
-
namespace
filetypes
Tools for determining a file’s type (pdf, image, mp3, et al) and ways how to deal with that.
See sh::tools::filetypes::FileTypeManager for more.
-
class
FileTypeManager
: public QObject, public sh::base::Singleton - #include <filetypemanager.h>
Utilities for dealing with file types.
It can determine the type of a file (png, plaintext, html, …), it can provide information about how to open them with an external program, and more.
For most tasks it uses a pluggable interface. Actual implementations of strategies for those tasks reside in separate classes in this namespace.
Public Functions
Determines the mimetype for one file.
Determines the mimetypes for a list of files.
Determines how to open a file with a given mimetype with an external program.
-
QList<std::shared_ptr<OpenMethod>>
getAllOpenMethods
() Returns a list of all known infos how to open a file external programs.
This has roughly one entry for each installed program on the user’s system, which can graphically open files.
-
void
doInitialize
() Executes singleton initialization.
-
void
doShutdown
() Executes singleton shutdown.
-
void
shutdown
() Shutdown down this singleton.
-
bool
isAlive
() Returns if this singleton is alive (true until its shutdown begins).
Private Functions
-
FileTypeManager
(QObject *parent = 0)
Private Members
-
QList<std::shared_ptr<MimetypeDeterminationStrategy>>
_mimetypeDeterminationMethods
-
QList<std::shared_ptr<OpenMethodDeterminationStrategy>>
_openMethodDeterminationMethods
-
QList<std::shared_ptr<MimetypeInformationRetrievalStrategy>>
_mimetypeInformationRetrievalMethods
-
QMutex
_mutex
-
class
MimetypeDeterminationStrategy
- #include <filetypemanager.h>
Abstract base class for a mimetype determination strategy.
Subclassed by sh::tools::filetypes::FreedesktopOrgToolsMimetypeDeterminationStrategy, sh::tools::filetypes::SuffixListMimetypeDeterminationStrategy, sh::tools::filetypes::UnixFileToolMimetypeDeterminationStrategy
Public Functions
-
~MimetypeDeterminationStrategy
()
-
-
class
MimetypeInformationRetrievalStrategy
- #include <filetypemanager.h>
Abstract base class for mimetype information retrieval strategy.
Subclassed by sh::tools::filetypes::FreeDesktopOrgMimetypeInformationRetrievalStrategy
Public Functions
-
QStringList
getMimetypeSubclasses
(QString mimetype)
-
~MimetypeInformationRetrievalStrategy
()
-
QStringList
-
class
OpenMethodDeterminationStrategy
- #include <filetypemanager.h>
Abstract base class for a ‘open method’ determination strategy.
Subclassed by sh::tools::filetypes::FreedesktopOrgToolsOpenMethodDeterminationStrategy, sh::tools::filetypes::UserDefinedOpenMethodDeterminationStrategy
Public Functions
-
~OpenMethodDeterminationStrategy
()
-
-
class
FreeDesktopOrgMimetypeInformationRetrievalStrategy
: public sh::tools::filetypes::FileTypeManager::MimetypeInformationRetrievalStrategy - #include <freedesktoporgmimetypeinformationretrievalstrategy.h>
Tries to determine some mimetype information with the freedesktop.org specs.
Public Functions
-
FreeDesktopOrgMimetypeInformationRetrievalStrategy
()
-
QStringList
getMimetypeSubclasses
(QString mimetype)
Private Members
-
QHash<QString, QStringList>
_mimeSubclassOf
-
QMutex
_mutex
-
QWaitCondition
_cond_inited
-
bool
_inited
= false
-
class
MimetypeInfo
: public QXmlDefaultHandler Public Functions
-
MimetypeInfo
() = default
-
bool
startElement
(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
-
bool
endElement
(const QString &namespaceURI, const QString &localName, const QString &qName)
Public Members
-
QStringList
subClassOf
-
-
-
class
FreedesktopOrgToolsMimetypeDeterminationStrategy
: public sh::tools::filetypes::FileTypeManager::MimetypeDeterminationStrategy - #include <freedesktoporgtoolsmimetypedeterminationmethod.h>
Tries to determine a file’s mimetype with the freedesktop.org tools.
Public Functions
-
FreedesktopOrgToolsMimetypeDeterminationStrategy
(sh::tools::filetypes::FileTypeManager *manager)
Private Members
-
QMutex
_mutex
-
QString
_pathToFileTool
-
const QRegularExpression
_reMimetype
Private Static Attributes
-
std::shared_ptr<sh::configuration::ConfigurationValue>
cfgvalXdgmimePath
= sh::configuration::ConfigurationManager::instance()->registerConfigValue("sh::tools::filetypes::FreedesktopOrgToolsMimetypeDeterminationStrategy.XdgmimePath", "/usr/bin/xdg-mime", sh::configuration::ConfigurationValue::valueTypeLocalFilePath(), QObject::tr("Path to the 'xdg-mime' tool"), sh::configuration::ConfigurationCategory::CategoryExternalTools, QObject::tr("This tool is possibly used for file type detection."))
-
-
class
FreedesktopOrgToolsOpenMethodDeterminationStrategy
: public sh::tools::filetypes::FileTypeManager::OpenMethodDeterminationStrategy - #include <freedesktoporgtoolsopenmethoddeterminationmethod.h>
Tries to determine a ‘open method’ for a file with the freedesktop.org tools.
Public Functions
-
FreedesktopOrgToolsOpenMethodDeterminationStrategy
()
-
~FreedesktopOrgToolsOpenMethodDeterminationStrategy
()
Private Functions
-
QString
_parseValue
(QStringList content, QString key)
-
void
_parseExecLine
(QString execline, QString *command, QStringList *arguments)
-
QString
_escapeExecLineToken
(QString s)
Private Members
-
QMultiMap<QString, ApplicationEntry*>
_mimetype2applicationEntry
-
QMutex
_mutex
-
QWaitCondition
_cond_inited
-
bool
_inited
= false
-
struct
ApplicationEntry
Public Members
-
QString
name
-
QStringList
mimetypes
-
QString
command
-
QStringList
commandargs
-
QIcon
icon
-
QString
-
-
struct
OpenMethod
- #include <filetypemanager.h>
Commandline and infos for opening a file with an external program.
Public Functions
-
OpenMethod
(QString name, QString command, QStringList arguments, QIcon icon = QIcon(), int precedence = 0)
Public Members
-
const QString
name
-
const QString
command
-
const QStringList
arguments
-
const QIcon
icon
-
const int
precedence
-
-
class
SuffixListMimetypeDeterminationStrategy
: public sh::tools::filetypes::FileTypeManager::MimetypeDeterminationStrategy - #include <suffixlistmimetypedeterminationmethod.h>
Tries to determine a file’s mimetype with an internal lookup table of file extensions.
Public Functions
-
SuffixListMimetypeDeterminationStrategy
()
Private Members
-
QHash<QString, QString>
_suffixToMimetype
-
QMutex
_mutex
-
-
class
UnixFileToolMimetypeDeterminationStrategy
: public sh::tools::filetypes::FileTypeManager::MimetypeDeterminationStrategy - #include <unixfiletoolmimetypedeterminationmethod.h>
Tries to determine a file’s mimetype with the unix
file
tool.Public Functions
-
UnixFileToolMimetypeDeterminationStrategy
(sh::tools::filetypes::FileTypeManager *manager)
Public Static Attributes
-
std::shared_ptr<sh::configuration::ConfigurationValue>
cfgvalFilePath
= sh::configuration::ConfigurationManager::instance()->registerConfigValue("sh::tools::filetypes::UnixFileToolMimetypeDeterminationStrategy.FilePath", "/usr/bin/file", sh::configuration::ConfigurationValue::valueTypeLocalFilePath(), QObject::tr("Path to the 'file' tool"), sh::configuration::ConfigurationCategory::CategoryExternalTools, QObject::tr("This tool is possibly used for file type detection."))
Private Members
-
QString
_pathToFileTool
-
const QRegularExpression
_reMimetype
-
QMutex
_mutex
-
-
class
UserDefinedOpenMethodDeterminationStrategy
: public sh::tools::filetypes::FileTypeManager::OpenMethodDeterminationStrategy, public sh::base::Singleton - #include <userdefinedopenmethoddeterminationstrategy.h>
Tries to determine a ‘open method’ for a file by information the user stored before.
Public Functions
Stores a custom open method.
-
void
doInitialize
() Executes singleton initialization.
-
void
doShutdown
() Executes singleton shutdown.
-
void
shutdown
() Shutdown down this singleton.
-
bool
isAlive
() Returns if this singleton is alive (true until its shutdown begins).
Private Functions
-
UserDefinedOpenMethodDeterminationStrategy
()
Private Members
-
QMutex
_mutex
-
class
-
namespace
thumbnailproviders
Thumbnail providers.
Subclasses of sh::tools::ThumbnailProvider (and possibly some auxiliary stuff). Those classes are used for generating thumbnail pictures for files.
-
class
DefaultImageThumbnailProvider
: public sh::tools::ThumbnailProvider - #include <defaultimagethumbnailprovider.h>
Thumbnail provider for images.
Public Functions
-
DefaultImageThumbnailProvider
() = default
Public Static Functions
-
void
doInitialize
()
-
void
doShutdown
()
-
-
class
FfmpegVideoThumbnailProvider
: public QObject, public sh::tools::ThumbnailProvider - #include <ffmpegvideothumbnailprovider.h>
Thumbnail provider for videos using the ffmpeg tool.
Public Functions
-
FfmpegVideoThumbnailProvider
()
Public Static Functions
-
void
doInitialize
()
-
void
doShutdown
()
Private Members
-
QString
pathToFfmpegTool
-
QString
pathToFfprobeTool
-
const QRegularExpression
reDuration
-
QMutex
mutexReDuration
Private Static Attributes
-
std::shared_ptr<sh::configuration::ConfigurationValue>
cfgvalFfmpegPath
= sh::configuration::ConfigurationManager::instance()->registerConfigValue("sh::tools::thumbnailproviders::FfmpegVideoThumbnailProvider.FfmpegPath", "/usr/bin/ffmpeg", sh::configuration::ConfigurationValue::valueTypeLocalFilePath(), QObject::tr("Path to the 'ffmpeg' tool"), sh::configuration::ConfigurationCategory::CategoryExternalTools, QObject::tr("This tool is possibly used for getting infos about video files."))
-
-
class
ImageMagickPdfThumbnailProvider
: public QObject, public sh::tools::ThumbnailProvider - #include <imagemagickpdfthumbnailprovider.h>
Thumbnail provider for videos using the ffmpeg tool.
Public Functions
-
ImageMagickPdfThumbnailProvider
()
Public Static Functions
-
void
doInitialize
()
-
void
doShutdown
()
Private Members
-
QString
pathToImagemagickConvertTool
Private Static Attributes
-
std::shared_ptr<sh::configuration::ConfigurationValue>
cfgvalImagemagickConvertPath
= sh::configuration::ConfigurationManager::instance()->registerConfigValue("sh::tools::thumbnailproviders::ImageMagickPdfThumbnailProvider.ImagemagickConvertPath", "/usr/bin/convert", sh::configuration::ConfigurationValue::valueTypeLocalFilePath(), QObject::tr("Path to the 'convert' tool of ImageMagick"), sh::configuration::ConfigurationCategory::CategoryExternalTools, QObject::tr("This tool is used for getting thumbnails of some file types."))
-
-
class
PlaintextThumbnailProvider
: public sh::tools::ThumbnailProvider - #include <plaintextthumbnailprovider.h>
Thumbnail provider for plain text.
Public Functions
-
PlaintextThumbnailProvider
()
Public Static Functions
-
void
doInitialize
()
-
void
doShutdown
()
Private Members
-
QColor
brandingcolor
-
-
class
-
class