Namespace sh

namespace sh

Shallot root.

class MainInit

(Un)Initialization for main app.

Public Static Functions

void doInitialize()
void doShutdown()

Public Static Attributes

sh::base::SingletonInitializer *singletonInitializer = nullptr
sig_atomic_t caughtSigterm = 0
namespace actions

Infrastructure for actions (submenus, executable ones, and more), as shown in the toolbar and menus and used at some other places.

See the abstract base class sh::actions::AbstractActionItem for more.

class AbstractActionFactory
#include <actionfactory.h>

Abstract base class for an action factory.

It creates an instance of a certain subclass of AbstractActionItem. It can also check if it is defined to be created in a given situation (e.g. not all actions are visible in toolbar).

Subclassed by sh::actions::ActionFactory< T >, sh::scripting::api::ApiActionFactory

Public Functions

AbstractActionFactory(std::shared_ptr<sh::actions::ActionCategory> category, QList<std::shared_ptr<Predicate>> predicates)

Is (for subclasses) intended to be directly constructed and registered once.

~AbstractActionFactory()
std::shared_ptr<ActionInstantiation> actionAvailable(ActionInstantiation *instantiation)
std::shared_ptr<sh::actions::AbstractActionItem> construct(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) = 0

Private Members

std::shared_ptr<sh::actions::ActionCategory> category
QList<std::shared_ptr<Predicate>> predicates
class AbstractActionItem : public QObject, public std::enable_shared_from_this<AbstractActionItem>
#include <abstractactionitem.h>

Abstract base class for executable actions, submenus of them, and more.

See the subclasses of this class.

They are used at various places. The toolbar and context menus provide them to the user.

They can be registered e.g. in a sh::actions::ActionFactory or returned from sh::filesystem::FilesystemHandler.getActions in order to make them available.

Subclassed by sh::actions::ActionActionItem, sh::actions::HeaderActionItem, sh::actions::SeparatorActionItem, sh::actions::SubmenuActionItem

Public Functions

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

AbstractActionItem()

Signals

void changed()

Emits when some data changed.

Private Members

QString _text
QString _icon
bool _enabled
bool _visible
bool _ischeckable
bool _ischecked
bool _initialized
bool _initializing
bool _reinitialize
std::weak_ptr<AbstractActionItem> _parentAction = NO_PARENT
int _defaultActionPrecedence

Private Static Attributes

QWaitCondition initcondition
class ActionActionItem : public sh::actions::AbstractActionItem
#include <actionactionitem.h>

Abstract base class for an executable action.

It can be made visible in menus or the toolbar or executed directly.

Subclasses provide the actual implementation by implementing action. Execution can be triggered from outside by calling execute.

Subclassed by sh::actions::common::ActionAbstractTransferTree, sh::actions::common::ActionAddToBookmarks, sh::actions::common::ActionBookmark, sh::actions::common::ActionClipboardCopy, sh::actions::common::ActionClipboardCut, sh::actions::common::ActionClipboardPaste, sh::actions::common::ActionClipboardPasteAsLink, sh::actions::common::ActionCreateFile, sh::actions::common::ActionCreateFolder, sh::actions::common::ActionDeleteItems, sh::actions::common::ActionExecute, sh::actions::common::ActionManageBookmarks, sh::actions::common::ActionNavigateInHistory, sh::actions::common::ActionOpenArchive, sh::actions::common::ActionOpenDirectoryInNewWindow, sh::actions::common::ActionOpenFile, sh::actions::common::ActionOpenFileWith::_ActionOpenFileWithEntry, sh::actions::common::ActionOpenFileWith::_ActionOpenFileWithUI, sh::actions::common::ActionOpenSharcArchive, sh::actions::common::ActionOpenTerminalAsUser, sh::actions::common::ActionRenameItem, sh::actions::common::ActionShowProperties, sh::actions::common::ActionTransferToHelper, sh::actions::mainmenu::ActionAbout, sh::actions::mainmenu::ActionAbstractSelectNodes, sh::actions::mainmenu::ActionApplyProfile::ActionApplyProfileX, sh::actions::mainmenu::ActionFileViewChangeIconDimension, sh::actions::mainmenu::ActionFileviewFilesizeFormatting, sh::actions::mainmenu::ActionFileviewShowHiddenFiles, sh::actions::mainmenu::ActionFileviewView, sh::actions::mainmenu::ActionGotoDirectory, sh::actions::mainmenu::ActionHelp, sh::actions::mainmenu::ActionManageSavedSettings, sh::actions::mainmenu::ActionNumberFileviews_Add, sh::actions::mainmenu::ActionNumberFileviews_Remove, sh::actions::mainmenu::ActionNumberFileviews_Remove_Current, sh::actions::mainmenu::ActionQuit, sh::actions::mainmenu::ActionRefresh, sh::actions::mainmenu::ActionSaveSettings, sh::actions::mainmenu::ActionSearch, sh::actions::mainmenu::ActionSetWindowTitlePattern, sh::actions::mainmenu::ActionShowDetailPanel, sh::actions::mainmenu::ActionShowFolderTree, sh::actions::mainmenu::ActionShowLog, sh::actions::mainmenu::ActionTreeStickyness, sh::actions::mainmenu::ActionTuning, sh::filepropertydialogtabs::FilePropertyDialogTabExtendedAttributes::ActionAddAttribute, sh::filepropertydialogtabs::FilePropertyDialogTabExtendedAttributes::ActionChangeAttribute, sh::filepropertydialogtabs::FilePropertyDialogTabExtendedAttributes::ActionRemoveAttribute, sh::filepropertydialogtabs::FilePropertyDialogTabUnixPermissions::ActionChange, sh::filesystemhandlers::ActionMountGnomeIOLocation, sh::filesystemhandlers::ActionMountNetworkGnomeIOLocation, sh::filesystemhandlers::ActionUnmountGnomeIOLocation, sh::scripting::api::ApiActionActionItem, sh::scripting::ScriptingEngine::ActionPluginLoadCrashedAgain, sh::search::criteria::ActionAbstractActionDrivenSearchCriterionConfigure

Public Functions

ActionActionItem(QString text, bool enabled = true, QString icon = QString(), int defaultActionPrecedence = 0, bool checkable = false, bool ischecked = false)

Is (for subclasses) intended to be directly constructed from everywhere or by registering a factory somewhere.

void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionCategory
#include <actioncategory.h>

Action categories are used for grouping actions in menus.

They provide the primary grouping in the toolbar an the context menus. Per default, the categories "create", "open" and "manage" exist.

Public Functions

ActionCategory(QString name, QString label, QString icon)

Constructed only by the infrastructure and made available otherwise.

QString name()

The category name.

QString label()

The category label.

QString icon()

The category icon.

Public Static Functions

std::shared_ptr<ActionCategory> getByName(QString name)

Gets a category by name.

std::shared_ptr<ActionCategory> add(QString name, QString label, QString icon)

Adds a new category.

QList<std::shared_ptr<ActionCategory>> categories()

Returns a list of all existing categories.

void doInitialize()
void doShutdown()

Private Members

QString _name
QString _label
QString _icon

Private Static Attributes

QList<std::shared_ptr<ActionCategory>> _categories
class ActionDefaultPrecedenceValues
#include <abstractactionitem.h>

Reference values for calculating default precedence values of actions.

Public Static Attributes

const int PRECEDENCE_OPENFILE = 300000

Normal file open action.

const int PRECEDENCE_BUILTIN_SPECIAL_OPEN = 600000

Special open action.

class ActionExecutionInfo : public QObject
#include <actionexecutioninfo.h>

Programming interface for giving status infos and communication with the user in an action execution.

An instance is always available during an execution.

Public Functions

ActionExecutionInfo(QObject *parent = 0)

Constructed only by the infrastructure and made available otherwise.

~ActionExecutionInfo()
void setVisualProcessFeedbackActive(bool active)

Specifies if there must be a visual process feedback.

The visual process feedback is typically realized as a dialog showing progress information.

Note: It can also appear in some situations, even if this property is set to false.

bool isVisualProcessFeedbackActive()

Determines if there must be a visual process feedback.

void setManualInterventionNeeded(bool isneeded)

Specifies if manual input is currently required.

bool isManualInterventionNeeded()

Determines if manual input is currently required.

void startExecution(std::shared_ptr<sh::actions::AbstractActionItem> action)

Triggers the beginning of the actual execution. .

void finishExecution()

Triggers the finishing of the execution. .

void setDetails(QString fromverb, QString fromobj, QString toverb = QString(), QString toobj = QString())

Sets some detail texts.

QString fromVerb()

Gets detail text ‘from-verb’.

QString fromObjectName()

Gets detail text ‘from-objectname’.

QString toVerb()

Gets detail text ‘to-verb’.

QString toObjectName()

Gets detail text ‘to-objectname’.

void setHead(QString text)

Sets the header text.

QString head()

Gets the header text.

void setProgressIndeterminate(QString text = QString())

Sets progress information to ‘indeterminate’.

void setProgress(quint64 done, quint64 all, QString text)

Sets progress information.

bool isProgressDeterminate()

Gets if progress information is ‘indeterminate’.

quint64 progressDone()

Gets count of finished items.

quint64 progressAll()

Gets count of all items.

QString progressText()

Gets progress information text.

sh::actions::ActionExecutionUserFeedback *userfeedback()

Program interface for interactive user input.

bool isCancelled()

Gets if the current action execution was cancelled.

void cancel()

Cancel the current action execution.

Used from outside, e.g. as handler for a ‘Cancel’ button.

void respectCancel()

Called regularly from an action execution code in order to cancel execution at that place, if the user has cancelled it.

void withExecuteGuards_infodlg(std::function<void()>int flags = 0, )

Executes code with different exception handlers for presenting exceptions in the action execution inside the action dialog (instead of the default exception dialog).

sh::filesystem::Operation *operation()

Program interface for operations on the filesystem (reading or writing).

void addChangedEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Reminds an important change of a certain node in the filesystem (file created, modified, removed?).

The infrastructure will force the ui to refresh those nodes.

void shutdown(bool success)

Shuts down this execution info and releases resources.

Signals

void detailsChanged()

Signal for changed execution details.

void headChanged()

Signal for changed head.

void progressChanged()

Signal for changed progress.

void visualProcessFeedbackActiveChanged()

Signal for changed visibility-required.

void wasCancelled()

Signal for cancellation on user behalf.

bool manualInterventionNeededChanged()

Signal for changed manual-intervention-needed.

Private Functions

std::shared_ptr<sh::ui::ActionExecutionInfoDialog> createDialog()
std::shared_ptr<ui::ActionExecutionInfoPanel> createPanel(sh::ui::ActionExecutionInfoDialog *dialog)

Private Members

QMutex mutex
QString _head
QString _fromverb
QString _fromobj
QString _toverb
QString _toobj
bool _progressDeterminate
quint64 _progressDone
quint64 _progressAll
bool _visualProcessFeedbackActive = false
bool _wasAlwaysInvisible = true
bool _manualInterventionNeeded = false
QString _progressText
std::shared_ptr<sh::ui::ActionExecutionInfoDialog> infodialog = 0
std::shared_ptr<sh::ui::ActionExecutionInfoPanel> infopanel = 0
bool _iscancelled = false
sh::filesystem::Operation _operation
QList<std::shared_ptr<const sh::filesystem::Eurl>> changes
QStack<std::shared_ptr<sh::actions::AbstractActionItem>> stack

Private Slots

void _checkVisibilityOnce()
class ActionExecutionUserFeedback
#include <actionexecutionuserfeedback.h>

Methods for user interaction in an action execution.

When an action executes, it may need to ask the user for some input at some time. An action implementation can do so by calling those methods. It is available as a member of the ActionExecutionInfo class. An instance of it is available in each action execution.

Subclassed by sh::ui::ActionExecutionInfoDialog

Public Types

enum MessageBoxButton

Buttons in a message box from ActionExecutionUserFeedback.

Values:

enumerator NONE = 0
enumerator OK = 1 << 0
enumerator Continue = 1 << 1
enumerator Cancel = 1 << 2
enumerator Retry = 1 << 3
enumerator Yes = 1 << 4
enumerator No = 1 << 5

Public Functions

int messageBox(QString text, QList<QString> answers, QString icon = QString(), int defaultanswer = -1, int cancelanswer = -1, QList<QString> answericons = QList<QString>()) = 0
int inputBox(QString text, QList<QString> answers, QString *value, QString icon = QString(), int defaultanswer = -1, int cancelanswer = -1, int valuePreselectFrom = -1, int valuePreselectTo = -1) = 0
int multilineInputBox(QString text, QList<QString> answers, QString *value, QString icon = QString(), int defaultanswer = -1, int cancelanswer = -1) = 0
int simpleChooserGridform(QString text, GridformEntries *entries, QStringList answers, int defaultanswer = -1, int cancelanswer = -1) = 0
bool credentialsDialog(QString text, bool showDomain, bool showUsername, bool showPassword, bool showAnonymous, bool showRemember, QString *domain, QString *username, QString *password, bool *isAnonymous, bool *isRemember) = 0
bool unixPermissionsDialog(bool *userMayRead, bool *userMayWrite, bool *userMayExecute, bool *groupMayRead, bool *groupMayWrite, bool *groupMayExecute, bool *othersMayRead, bool *othersMayWrite, bool *othersMayExecute, bool *sticky, bool *setuid, bool *setgid, QStringList users, QStringList groups, QString *ownerUser, QString *ownerGroup) = 0
QString simpleInputBox(QString text, QString deflt, int valuePreselectFrom = -1, int valuePreselectTo = -1)
int simpleMessageBox(QString text, int buttons = (int)MessageBoxButton::OK, QString icon = QString(), int defaultbutton = (MessageBoxButton)0, int cancelbutton = (MessageBoxButton)0)
~ActionExecutionUserFeedback()
class Choice
#include <actionexecutionuserfeedback.h>

A data structure for a choice (in an GridformEntry).

Public Functions

Choice(QString label, QString text = QString())

Public Members

QString label
QString text
class Choices
#include <actionexecutionuserfeedback.h>

A data structure for a list of Choice instances.

Public Members

QList<Choice*> list
int selected = -1
class GridformEntries
#include <actionexecutionuserfeedback.h>

A data structure for a list of entries in a simple chooser grid form.

Public Functions

GridformEntries()

Is intended to be directly constructed from everywhere.

~GridformEntries()
GridformEntry *newEntry(QString label)

Public Members

QList<GridformEntry*> list
class GridformEntry
#include <actionexecutionuserfeedback.h>

A data structure for an entry in a simple chooser grid form.

Public Functions

GridformEntry(QString label, Choices choices)

Constructed only indirectly.

~GridformEntry()
int addChoice(QString label, QString text = QString())

Public Members

QString label
Choices choices
template<class T>
class ActionFactory : public sh::actions::AbstractActionFactory
#include <actionfactory.h>

A typical implementation for an action factory.

See base class for more.

Public Functions

ActionFactory(std::shared_ptr<sh::actions::ActionCategory> category, QList<std::shared_ptr<Predicate>> predicates)
std::shared_ptr<sh::actions::AbstractActionItem> construct(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
std::shared_ptr<ActionInstantiation> actionAvailable(ActionInstantiation *instantiation)
class ActionInstantiation
#include <actionfactory.h>

Holds various data around action creation.

Action creation is a process, which begins with querying all actions available for certain nodes. The action factories evaluate availabilities and store some construction information here. Many parties are involved in working with it. The created action, is stored in this object as well.

Public Functions

ActionInstantiation(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> selectedNodes = {}, std::shared_ptr<sh::filesystem::FilesystemNode> currentDirectory = nullptr)

Constructor for a typical fresh instance, containing infos about selected items and some more.

ActionInstantiation(const ActionInstantiation &s) = default

Clones an existing instance.

ActionInstantiation(const ActionInstantiation &s, std::shared_ptr<sh::actions::AbstractActionItem> createdAction)

Clones an existing instance and sets createdAction. This is a convenience constructor used for some special cases.

Public Members

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> selectedNodes

The selected nodes (initially: what’s selected in the active file list).

std::shared_ptr<sh::filesystem::FilesystemNode> currentDirectory

The current directory (which is visible in the active file list).

bool resolveLinks = true

If links shall be resolved for evaluation and action creation.

bool isLookupOnCurrentDirectoryLevel = false

If this instantiation refers to a lookup for actions on ‘current directory level’ (instead of ‘selection level’).

AbstractActionFactory *actionfactory = 0

The action faction.

std::shared_ptr<ActionCategory> category = 0

The action category.

std::shared_ptr<AbstractActionItem> createdAction = 0

The created action.

QKeySequence shortcut

The requested keyboard shortcut for the action.

int positionIndex = 0

The position information index.

class ActionsManager : public QObject, public sh::base::Singleton
#include <actionsmanager.h>

Factory for actions which are valid for a given list of FileSystemNode and tools for placing actions in some gui elements.

Public Functions

void getActions(std::shared_ptr<ActionInstantiation> instantiation, std::function<void(QList<std::shared_ptr<ActionInstantiation>>, QList<std::shared_ptr<sh::actions::ActionInstantiation>>)> callback, std::function<void(std::shared_ptr<ActionInstantiation>)> initializedcallback = [](std::shared_ptr< ActionInstantiation >){})

Asychonously gets actions for a list of sh::filesystem::FilesystemNode.

Parameters
  • nodes: The list of nodes.

  • callback: This callback is called once the list is fetched.

  • initializedcallback: This callback is called for each result action after initialization.

void getDefaultAction(QList<std::shared_ptr<sh::actions::AbstractActionItem>> actionList, std::function<void(std::shared_ptr<sh::actions::ActionActionItem>)> callback)

Determines the default action for a given list of actions.

Parameters
  • actionList: The list of all available actions.

  • callback: This callback is called when the default action was found (with an already initialized action).

void getActionForShortcut(QList<std::shared_ptr<filesystem::FilesystemNode>> selectedNodes, std::shared_ptr<filesystem::FilesystemNode> folderNode, int key, Qt::KeyboardModifiers modifiers, std::function<void(std::shared_ptr<sh::actions::AbstractActionItem>)> callback)

Asychonously gets the action for a shortcut.

Parameters
  • selectedNodes: The nodes which are currently selected in the active fileview.

  • folderNode: The folder which is shown by the active fileview.

  • key: The keypress character code.

  • modifiers: The keypress modifiers.

  • callback: This callback is called when an action was found (with an already initialized action).

void registerActionFactory(std::shared_ptr<sh::actions::AbstractActionFactory> actionFactory)

Registers an action factory.

This makes an action implementation available in the toolbar and context menus.

QList<std::shared_ptr<sh::actions::ActionActionItem>> runningActions()

Returns a list of all currently running actions.

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 runningActionsChanged()

Emitted when the list of running actions changed.

Public Static Functions

QString selectionLabel(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> selection)

Returns a short header label text for a node selection.

QString directoryLabel(std::shared_ptr<sh::filesystem::FilesystemNode> directory)

Returns a short header label text for a current directory.

void sortAndSeparateActions(QList<std::shared_ptr<ActionInstantiation>> *actions)

Sorts a lists of actionitems and adds separators between groups. Modifies the given list.

Private Functions

ActionsManager()
QList<std::shared_ptr<ActionInstantiation>> _getActions_raw(std::shared_ptr<ActionInstantiation> instantiation)
void _emit_runningActionsChanged()
void recursivelyInitializeAction(std::shared_ptr<sh::actions::ActionInstantiation> actsit, std::function<void(std::shared_ptr<sh::actions::ActionInstantiation>)> callback, QList<std::shared_ptr<sh::actions::ActionInstantiation>> sits = {}, )

Recursively initializes a list of action items and calls a callback for each action item recursively afterwards.

Parameters
  • actions: List of all action items to traverse.

  • callback: This callback is called for each action item (even indirectly in a subtree hierarchy).

void _getDefaultAction_helper(QList<std::shared_ptr<sh::actions::AbstractActionItem>> actionList, std::shared_ptr<GDAHstruct> gdah)

Internal helper for the public getDefaultAction() method.

std::shared_ptr<sh::actions::ActionsManager::RunningActionsCounter> _actionExecutionStarted(std::shared_ptr<sh::actions::ActionActionItem> action)

Helper for updating _runningactions. .

Private Members

QList<std::shared_ptr<sh::actions::AbstractActionFactory>> _actionfactories
QMutex _mutex_actionfactories
QList<std::shared_ptr<sh::actions::ActionActionItem>> _runningactions
QMutex _mutex_runningactions

Friends

friend class ActionActionItem
struct GDAHstruct

Internal data structure used for _getDefaultAction_helper();.

Public Functions

GDAHstruct() = default
GDAHstruct(const GDAHstruct &o) = default

Public Members

sh::tools::AtomicCounter counter
std::function<void(std::shared_ptr<sh::actions::ActionActionItem>)> callback
int currentValue = 0
QList<std::shared_ptr<sh::actions::AbstractActionItem>> initialActionList
std::shared_ptr<sh::actions::AbstractActionItem> currentAction = 0
class RunningActionsCounter

Helper for updating _runningactions. .

Public Functions

RunningActionsCounter(ActionsManager *manager, std::shared_ptr<sh::actions::ActionActionItem> action)
~RunningActionsCounter()

Private Members

ActionsManager *_manager
std::shared_ptr<sh::actions::ActionActionItem> _action
class ByRegExpPredicate : public sh::actions::Predicate
#include <actionfactory.h>

Shows actions only when the selection paths matches a regular expression.

Public Functions

ByRegExpPredicate(QString regexp)
bool evaluate(ActionInstantiation *instantiation)

Evaluates if the predicate is solved.

If it returns true, the evaluation proceeds and eventually succeeds. If false, it stops at this place.

void prepare(ActionInstantiation *instantiation)

Prepares the evaluation.

Private Members

QRegExp filterRegExp
class DontResolveLinksPredicate : public sh::actions::Predicate
#include <actionfactory.h>

Disables links resolving.

Public Functions

DontResolveLinksPredicate()
void prepare(ActionInstantiation *instantiation)

Prepares the evaluation.

bool evaluate(ActionInstantiation *instantiation)

Evaluates if the predicate is solved.

If it returns true, the evaluation proceeds and eventually succeeds. If false, it stops at this place.

class HeaderActionItem : public sh::actions::AbstractActionItem
#include <headeractionitem.h>

A header.

Use it as all the other AbstractActionItem classes. It will lead to a visual header in the parent menu.

Public Functions

HeaderActionItem(QString text, QString icon = QString())

Is intended to be directly constructed from everywhere.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class HideOnCurrentDirectoryLevelPredicate : public sh::actions::Predicate
#include <actionfactory.h>

Shows actions only when not searching for ‘current directory level’ actions.

Public Functions

HideOnCurrentDirectoryLevelPredicate()
bool evaluate(ActionInstantiation *instantiation)

Evaluates if the predicate is solved.

If it returns true, the evaluation proceeds and eventually succeeds. If false, it stops at this place.

void prepare(ActionInstantiation *instantiation)

Prepares the evaluation.

class HideOnSelectionLevelPredicate : public sh::actions::Predicate
#include <actionfactory.h>

Shows actions only when not searching for ‘selection level’ actions.

Public Functions

HideOnSelectionLevelPredicate()
bool evaluate(ActionInstantiation *instantiation)

Evaluates if the predicate is solved.

If it returns true, the evaluation proceeds and eventually succeeds. If false, it stops at this place.

void prepare(ActionInstantiation *instantiation)

Prepares the evaluation.

class KeyShortcutPredicate : public sh::actions::Predicate
#include <actionfactory.h>

Sets a keyboard shortcut.

Public Functions

KeyShortcutPredicate(QKeySequence shortcut, bool triggersOnCurrentDirectoryLevel)
void prepare(ActionInstantiation *instantiation)

Prepares the evaluation.

bool evaluate(ActionInstantiation *instantiation)

Evaluates if the predicate is solved.

If it returns true, the evaluation proceeds and eventually succeeds. If false, it stops at this place.

Private Members

QKeySequence shortcut
bool triggersOnCurrentDirectoryLevel
class OnDirectoriesPredicate : public sh::actions::Predicate
#include <actionfactory.h>

Shows actions only on directories.

Public Functions

OnDirectoriesPredicate()
bool evaluate(ActionInstantiation *instantiation)

Evaluates if the predicate is solved.

If it returns true, the evaluation proceeds and eventually succeeds. If false, it stops at this place.

void prepare(ActionInstantiation *instantiation)

Prepares the evaluation.

class OnFilesPredicate : public sh::actions::Predicate
#include <actionfactory.h>

Shows actions only on files.

Public Functions

OnFilesPredicate()
bool evaluate(ActionInstantiation *instantiation)

Evaluates if the predicate is solved.

If it returns true, the evaluation proceeds and eventually succeeds. If false, it stops at this place.

void prepare(ActionInstantiation *instantiation)

Prepares the evaluation.

class OnLinksPredicate : public sh::actions::Predicate
#include <actionfactory.h>

Shows actions only on links.

Public Functions

OnLinksPredicate()
bool evaluate(ActionInstantiation *instantiation)

Evaluates if the predicate is solved.

If it returns true, the evaluation proceeds and eventually succeeds. If false, it stops at this place.

void prepare(ActionInstantiation *instantiation)

Prepares the evaluation.

class OnSingleEntrySelectionPredicate : public sh::actions::Predicate
#include <actionfactory.h>

Shows actions only on single-entry selections.

Public Functions

OnSingleEntrySelectionPredicate()
bool evaluate(ActionInstantiation *instantiation)

Evaluates if the predicate is solved.

If it returns true, the evaluation proceeds and eventually succeeds. If false, it stops at this place.

void prepare(ActionInstantiation *instantiation)

Prepares the evaluation.

class PositionIndexPredicate : public sh::actions::Predicate
#include <actionfactory.h>

Sets a positioning information index.

Public Functions

PositionIndexPredicate(int positionIndex)
void prepare(ActionInstantiation *instantiation)

Prepares the evaluation.

bool evaluate(ActionInstantiation *instantiation)

Evaluates if the predicate is solved.

If it returns true, the evaluation proceeds and eventually succeeds. If false, it stops at this place.

Private Members

int positionIndex
class Predicate
#include <actionfactory.h>

Controls when and how an action is created in the action factory.

Subclassed by sh::actions::ByRegExpPredicate, sh::actions::DontResolveLinksPredicate, sh::actions::HideOnCurrentDirectoryLevelPredicate, sh::actions::HideOnSelectionLevelPredicate, sh::actions::KeyShortcutPredicate, sh::actions::OnDirectoriesPredicate, sh::actions::OnFilesPredicate, sh::actions::OnLinksPredicate, sh::actions::OnSingleEntrySelectionPredicate, sh::actions::PositionIndexPredicate

Public Functions

Predicate()
void prepare(ActionInstantiation *instantiation)

Prepares the evaluation.

bool evaluate(ActionInstantiation *instantiation)

Evaluates if the predicate is solved.

If it returns true, the evaluation proceeds and eventually succeeds. If false, it stops at this place.

~Predicate()
class SeparatorActionItem : public sh::actions::AbstractActionItem
#include <separatoractionitem.h>

A separator.

Use it as all the other AbstractActionItem classes. It will lead to a visual separator in the parent menu.

Public Functions

SeparatorActionItem()

Is intended to be directly constructed from everywhere.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class SubmenuActionItem : public sh::actions::AbstractActionItem
#include <submenuactionitem.h>

Abstract base class for a submenu.

It can be made visible in menus or the toolbar or executed directly.

Subclasses fill the submenu with other actions in order to be useful.

Subclassed by sh::actions::common::ActionAbstractTransferTo, sh::actions::common::ActionBookmarkFolder, sh::actions::common::ActionGroups, sh::actions::common::ActionHistoryNavigate, sh::actions::common::ActionOpenFileWith, sh::actions::common::ActionOpenTerminal, sh::actions::mainmenu::ActionApplyProfile, sh::actions::mainmenu::ActionMain, sh::actions::mainmenu::ActionNumberFileviews, sh::scripting::api::ApiSubmenuActionItem

Public Functions

SubmenuActionItem(QString text, const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems = {}, bool enabled = true, QString icon = QString(), int defaultActionPrecedence = 0, bool checkable = false, bool ischecked = false)

Is (for subclasses) intended to be directly constructed from everywhere or by registering a factory somewhere.

const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems()

Returns the list of subitems from this submenu.

void setSubitems(const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems)

Sets the subitems.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void subitemsChanged()

Emits when the list of subitems changed.

void changed()

Emits when some data changed.

Private Members

QList<std::shared_ptr<sh::actions::AbstractActionItem>> _subitems
namespace common

Implementations of actions.

Subclasses of sh::actions::AbstractActionItem (and possibly some auxiliary stuff). Many action implementations used in Shallot are here. You can find other actions in the sibling namespaces and a few very special ones at different places.

class ActionAbstractTransferTo : public sh::actions::SubmenuActionItem
#include <actiontransferto.h>

Abstract action for transferring a selection to some other locations (e.g. to other file views, bookmarks).

Subclassed by sh::actions::common::ActionTransferToCopy, sh::actions::common::ActionTransferToMove

Public Functions

ActionAbstractTransferTo(QString text, QString icon, QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems()

Returns the list of subitems from this submenu.

void setSubitems(const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems)

Sets the subitems.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void subitemsChanged()

Emits when the list of subitems changed.

void changed()

Emits when some data changed.

Friends

friend class ActionTransferToHelper
class ActionAbstractTransferTree : public sh::actions::ActionActionItem
#include <actionabstracttransfertree.h>

Abstract action for transferring (copying, moving, et al) a tree of items.

Subclassed by sh::actions::common::ActionCopyTree

Public Functions

ActionAbstractTransferTree(QList<std::shared_ptr<const sh::filesystem::Eurl>> sources, std::shared_ptr<const sh::filesystem::Eurl> destination)
~ActionAbstractTransferTree()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void makereadableunits(double *value, QString *vunit)
class MyFilesystemOperationProgressMonitor : public sh::filesystem::FilesystemOperationProgressMonitor
#include <actionabstracttransfertree.h>

Public Functions

MyFilesystemOperationProgressMonitor(ActionExecutionInfo *info)
bool hasItemInfo()

Checks if this progress monitor provides information about how many items of a certain total number are transferred so far.

quint64 doneItems()

Checks how many items are transferred so far.

quint64 allItems()

Checks how many items are to be transferred in total (as predicted in the current moment).

bool hasBytesInfo()

Checks if this progress monitor provides information about how many byte of a certain total number are transferred so far.

quint64 doneBytes()

Checks how many bytes are transferred so far.

quint64 allBytes()

Checks how many bytes are to be transferred in total (as predicted in the current moment).

QString getItemInfoFrom()

Returns the current source of transfer (as textual information).

QString getItemInfoTo()

Returns the current destination of transfer (as textual information).

QString estimation()

Returns the current performance and time estimation (as textual information).

class ActionAddToBookmarks : public sh::actions::ActionActionItem
#include <actionbookmarks.h>

Action for bookmarking a directory.

Public Functions

ActionAddToBookmarks(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void doInitialize()
void doShutdown()
class ActionBookmark : public sh::actions::ActionActionItem
#include <actionbookmarks.h>

Action for navigating to a certain bookmark.

Public Functions

ActionBookmark(QString label, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionBookmarkFolder : public sh::actions::SubmenuActionItem
#include <actionbookmarks.h>

Submenu action of bookmarks.

Subclassed by sh::actions::common::ActionBookmarks

Public Functions

ActionBookmarkFolder(QString label)
void addSubitem(std::shared_ptr<sh::actions::AbstractActionItem> item)
void clearSubitems()
const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems()

Returns the list of subitems from this submenu.

void setSubitems(const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems)

Sets the subitems.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void subitemsChanged()

Emits when the list of subitems changed.

void changed()

Emits when some data changed.

class ActionBookmarks : public sh::actions::common::ActionBookmarkFolder
#include <actionbookmarks.h>

Bookmarking action (the main one you see in the toolbar)

Public Functions

ActionBookmarks()
void initialize()

Initialize the action. This should make the time-consuming parts, e.g. for determining a label or enabled state.

void addSubitem(std::shared_ptr<sh::actions::AbstractActionItem> item)
void clearSubitems()
const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems()

Returns the list of subitems from this submenu.

void setSubitems(const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems)

Sets the subitems.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void subitemsChanged()

Emits when the list of subitems changed.

void changed()

Emits when some data changed.

class ActionClipboardCopy : public sh::actions::ActionActionItem
#include <actionclipboard.h>

Action for copying to clipboard.

Public Functions

ActionClipboardCopy(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void doInitialize()
void doShutdown()
class ActionClipboardCut : public sh::actions::ActionActionItem
#include <actionclipboard.h>

Action for cutting to clipboard.

Public Functions

ActionClipboardCut(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void doInitialize()
void doShutdown()
class ActionClipboardPaste : public sh::actions::ActionActionItem
#include <actionclipboard.h>

Action for pasting from clipboard.

Public Functions

ActionClipboardPaste(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
bool shortcutTriggersOnFolder()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void doInitialize()
void doShutdown()
class ActionClipboardPasteAsLink : public sh::actions::ActionActionItem
#include <actionclipboard.h>

Action for pasting from clipboard as link.

Public Functions

ActionClipboardPasteAsLink(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void doInitialize()
void doShutdown()
class ActionCopyTree : public sh::actions::common::ActionAbstractTransferTree
#include <actioncopytree.h>

Action copying a filesystem tree to some other place.

Subclassed by sh::actions::common::ActionMoveTree

Public Functions

ActionCopyTree(QList<std::shared_ptr<const sh::filesystem::Eurl>> sources, std::shared_ptr<const sh::filesystem::Eurl> destination)
void action(sh::actions::ActionExecutionInfo *info)

The action implementation, i.e. what the actions should actually do.

void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void makereadableunits(double *value, QString *vunit)
class ActionCreateFile : public sh::actions::ActionActionItem
#include <actioncreatefile.h>

Action for creating a new file.

Public Functions

ActionCreateFile(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void doInitialize()
void doShutdown()
class ActionCreateFolder : public sh::actions::ActionActionItem
#include <actioncreatefolder.h>

Action for creating a new directory.

Public Functions

ActionCreateFolder(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
bool shortcutTriggersOnFolder()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void doInitialize()
void doShutdown()
class ActionDeleteItems : public sh::actions::ActionActionItem
#include <actiondeleteitems.h>

Action deleting a list of filesystem items.

Public Functions

ActionDeleteItems(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void doInitialize()
void doShutdown()
class ActionExecute : public sh::actions::ActionActionItem
#include <actionexecute.h>

Action executing a file (if executable).

Public Functions

ActionExecute(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void doInitialize()
void doShutdown()
class ActionGroups : public sh::actions::SubmenuActionItem
#include <actiongroups.h>

Action for showing registered actions grouped by an sh::actions::ActionCategory.

Public Functions

ActionGroups(std::shared_ptr<sh::actions::ActionCategory> category)
void setGroupActions(std::shared_ptr<sh::actions::ActionInstantiation> rootsituation, QList<std::shared_ptr<sh::actions::ActionInstantiation>> selacts, QList<std::shared_ptr<sh::actions::ActionInstantiation>> diracts)
const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems()

Returns the list of subitems from this submenu.

void setSubitems(const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems)

Sets the subitems.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void subitemsChanged()

Emits when the list of subitems changed.

void changed()

Emits when some data changed.

class ActionHistoryNavigate : public sh::actions::SubmenuActionItem
#include <actionnavigation.h>

Abstract action for navigating in the directory history stack (stepwise or randomly).

Subclassed by sh::actions::common::ActionHistoryNavigateBackward, sh::actions::common::ActionHistoryNavigateForward

Public Functions

ActionHistoryNavigate(QString text, std::function<QList<sh::tools::HistoryTracker<std::shared_ptr<const sh::filesystem::Eurl>>::HistoryEntry>()> _getentriesfctQString icon, )
const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems()

Returns the list of subitems from this submenu.

void setSubitems(const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems)

Sets the subitems.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void subitemsChanged()

Emits when the list of subitems changed.

void changed()

Emits when some data changed.

class ActionHistoryNavigateBackward : public sh::actions::common::ActionHistoryNavigate
#include <actionnavigation.h>

Action for navigating backward in the directory history stack.

Public Functions

ActionHistoryNavigateBackward()
const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems()

Returns the list of subitems from this submenu.

void setSubitems(const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems)

Sets the subitems.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void subitemsChanged()

Emits when the list of subitems changed.

void changed()

Emits when some data changed.

class ActionHistoryNavigateForward : public sh::actions::common::ActionHistoryNavigate
#include <actionnavigation.h>

Action for navigating forward in the directory history stack.

Public Functions

ActionHistoryNavigateForward()
const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems()

Returns the list of subitems from this submenu.

void setSubitems(const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems)

Sets the subitems.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void subitemsChanged()

Emits when the list of subitems changed.

void changed()

Emits when some data changed.

class ActionManageBookmarks : public sh::actions::ActionActionItem
#include <actionbookmarks.h>

Action for managing bookmarks.

Public Functions

ActionManageBookmarks()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionMoveTree : public sh::actions::common::ActionCopyTree
#include <actionmovetree.h>

Action moving a filesystem tree to some other place.

Public Functions

ActionMoveTree(QList<std::shared_ptr<const sh::filesystem::Eurl>> sources, std::shared_ptr<const sh::filesystem::Eurl> destination)
void action(sh::actions::ActionExecutionInfo *info)

The action implementation, i.e. what the actions should actually do.

void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void makereadableunits(double *value, QString *vunit)
class ActionNavigateInHistory : public sh::actions::ActionActionItem
#include <actionnavigation.h>

Action for navigating to one particular place in the directory history stack.

Public Functions

ActionNavigateInHistory(sh::ui::FileView *filelist, int idx, std::shared_ptr<const sh::filesystem::Eurl> eurl, bool isdefault)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionOpenArchive : public sh::actions::ActionActionItem
#include <actionopenarchive.h>

Action opening a sharc archive (by creating a root node for it).

Subclassed by sh::filesystemhandlers::ArchiveFilesystemHandler::ActionOpenTarArchive, sh::filesystemhandlers::ArchiveFilesystemHandler::ActionOpenZipArchive

Public Functions

ActionOpenArchive(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionOpenDirectoryInNewWindow : public sh::actions::ActionActionItem
#include <actionopendirectoryinnewwindow.h>

Action for opening a file with a automatically chosen program.

Public Functions

ActionOpenDirectoryInNewWindow(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void doInitialize()
void doShutdown()
class ActionOpenFile : public sh::actions::ActionActionItem
#include <actionopenfile.h>

Action for opening a file with a automatically chosen program.

Public Functions

ActionOpenFile(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void doInitialize()
void doShutdown()
class ActionOpenFileWith : public sh::actions::SubmenuActionItem
#include <actionopenfilewith.h>

Submenu action for opening a file with a manually chosen program.

Public Functions

ActionOpenFileWith(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems()

Returns the list of subitems from this submenu.

void setSubitems(const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems)

Sets the subitems.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void subitemsChanged()

Emits when the list of subitems changed.

void changed()

Emits when some data changed.

Public Static Functions

void waitProgramClosedIfNeeded(sh::actions::ActionExecutionInfo *info, QStringList filelist)
void doInitialize()
void doShutdown()

Friends

friend class ActionOpenFile
class _ActionOpenFileWithEntry : public sh::actions::ActionActionItem

Public Functions

_ActionOpenFileWithEntry(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes, QString name, QString cmd, QStringList arguments, QStringList rememberformimetype)
void action(sh::actions::ActionExecutionInfo *info)

The action implementation, i.e. what the actions should actually do.

void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Public Members

QString _command
QStringList _commandArguments
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> _nodes

Signals

void changed()

Emits when some data changed.

class _ActionOpenFileWithUI : public sh::actions::ActionActionItem

Public Functions

_ActionOpenFileWithUI(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes, QString mimetype)
void action(sh::actions::ActionExecutionInfo *info)

The action implementation, i.e. what the actions should actually do.

void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Public Members

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> _nodes
QString _mimetype

Signals

void changed()

Emits when some data changed.

class ActionOpenSharcArchive : public sh::actions::ActionActionItem
#include <actionopensharcarchive.h>

Action opening a sharc archive (by creating a root node for it).

Public Functions

ActionOpenSharcArchive(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void doInitialize()
void doShutdown()
class ActionOpenTerminal : public sh::actions::SubmenuActionItem
#include <actionopenterminal.h>

Action submenu with actions for opening commandline terminals.

Public Functions

ActionOpenTerminal(QString dir)
void initialize()

Initialize the action. This should make the time-consuming parts, e.g. for determining a label or enabled state.

const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems()

Returns the list of subitems from this submenu.

void setSubitems(const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems)

Sets the subitems.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void subitemsChanged()

Emits when the list of subitems changed.

void changed()

Emits when some data changed.

class ActionOpenTerminalAsRoot : public sh::actions::common::ActionOpenTerminalAsUser
#include <actionopenterminal.h>

Action for opening a commandline terminal as root.

Public Functions

ActionOpenTerminalAsRoot(QString dir)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionOpenTerminalAsUser : public sh::actions::ActionActionItem
#include <actionopenterminal.h>

Action for opening a commandline terminal (with current user).

Subclassed by sh::actions::common::ActionOpenTerminalAsRoot

Public Functions

ActionOpenTerminalAsUser(QString dir)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionRenameItem : public sh::actions::ActionActionItem
#include <actionrenameitem.h>

Action for renaming items.

Public Functions

ActionRenameItem(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void doInitialize()
void doShutdown()
class ActionShowProperties : public sh::actions::ActionActionItem
#include <actionshowproperties.h>

Action for showing the properties dialog for filesystem nodes.

Public Functions

ActionShowProperties(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void doInitialize()
void doShutdown()
class ActionTransferToCopy : public sh::actions::common::ActionAbstractTransferTo
#include <actiontransferto.h>

Action for copying a selection to some other locations.

Public Functions

ActionTransferToCopy(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems()

Returns the list of subitems from this submenu.

void setSubitems(const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems)

Sets the subitems.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void subitemsChanged()

Emits when the list of subitems changed.

void changed()

Emits when some data changed.

Public Static Functions

void doInitialize()

Only called by the Shallot infrastructure for initialization.

void doShutdown()

Only called by the Shallot infrastructure for initialization.

class ActionTransferToHelper : public sh::actions::ActionActionItem
#include <actiontransferto.h>

This action is used as subitems in ActionAbstractTransferTo.

Public Functions

ActionTransferToHelper(QString text, QString icon, std::shared_ptr<const sh::filesystem::Eurl> transferto, std::shared_ptr<ActionAbstractTransferTo> root)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionTransferToMove : public sh::actions::common::ActionAbstractTransferTo
#include <actiontransferto.h>

Action for moving a selection to some other locations.

Public Functions

ActionTransferToMove(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems()

Returns the list of subitems from this submenu.

void setSubitems(const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems)

Sets the subitems.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void subitemsChanged()

Emits when the list of subitems changed.

void changed()

Emits when some data changed.

Public Static Functions

void doInitialize()
void doShutdown()
namespace mainmenu

Implementation of the main menu.

Subclasses of sh::actions::AbstractActionItem (and possibly some auxiliary stuff). You can find other actions in the sibling namespaces and a few very special ones at different places.

class ActionAbout : public sh::actions::ActionActionItem
#include <actionabout.h>

Action showing the Shallot about box.

Public Functions

ActionAbout()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionAbstractSelectNodes : public sh::actions::ActionActionItem
#include <actionselect.h>

Abstract subclass for actions which select some nodes in the current file view.

Subclassed by sh::actions::mainmenu::ActionInvertNodeSelection, sh::actions::mainmenu::ActionSelectAllNodes

Public Functions

ActionAbstractSelectNodes(QString text)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionApplyProfile : public sh::actions::SubmenuActionItem
#include <actionapplyprofile.h>

Submenu action for switching the current profile.

Public Functions

ActionApplyProfile()
const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems()

Returns the list of subitems from this submenu.

void setSubitems(const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems)

Sets the subitems.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void subitemsChanged()

Emits when the list of subitems changed.

void changed()

Emits when some data changed.

class ActionApplyProfileX : public sh::actions::ActionActionItem

Action for switching the current profile to a certain one.

Public Functions

ActionApplyProfileX(QString profilename, bool checked)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionFileViewChangeIconDimension : public sh::actions::ActionActionItem
#include <actionfileviewchangeicondimension.h>

Action for changing the icon size.

Subclassed by sh::actions::mainmenu::ActionFileViewDecreaseIconDimension, sh::actions::mainmenu::ActionFileViewIncreaseIconDimension

Public Functions

ActionFileViewChangeIconDimension(QString name, int direction, QString icon, QKeySequence shortcut)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionFileViewDecreaseIconDimension : public sh::actions::mainmenu::ActionFileViewChangeIconDimension
#include <actionfileviewchangeicondimension.h>

Action for decreasing the icon size.

Public Functions

ActionFileViewDecreaseIconDimension()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionFileviewFilesizeFormatting : public sh::actions::ActionActionItem
#include <actionfileviewfilesizeformatting.h>

Action for toggling the filesize formatting mode for the current fileview.

Public Functions

ActionFileviewFilesizeFormatting()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionFileViewIncreaseIconDimension : public sh::actions::mainmenu::ActionFileViewChangeIconDimension
#include <actionfileviewchangeicondimension.h>

Action for increasing the icon size.

Public Functions

ActionFileViewIncreaseIconDimension()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionFileviewShowHiddenFiles : public sh::actions::ActionActionItem
#include <actionfileviewshowhiddenfiles.h>

Action which toggles the visibility of hidden files in the current fileview.

Public Functions

ActionFileviewShowHiddenFiles()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionFileviewView : public sh::actions::ActionActionItem
#include <actionfileviewview.h>

Action which toggles between icon- and listmode for the current fileview.

Public Functions

ActionFileviewView()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionGotoDirectory : public sh::actions::ActionActionItem
#include <actiongotodirectory.h>

Action which toggles the visibility of hidden files in the current fileview.

Public Functions

ActionGotoDirectory()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionHelp : public sh::actions::ActionActionItem
#include <actionhelp.h>

Action for opening the Shallot help system.

Public Functions

ActionHelp()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionInvertNodeSelection : public sh::actions::mainmenu::ActionAbstractSelectNodes
#include <actionselect.h>

Action for inverting the node selection in the current file view.

Public Functions

ActionInvertNodeSelection()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Private Members

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> wasselected
class ActionMain : public sh::actions::SubmenuActionItem, public sh::base::Singleton
#include <actionmain.h>

Submenu action providing the Shallot main menu.

Public Functions

const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems()

Returns the list of subitems from this submenu.

void setSubitems(const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems)

Sets the subitems.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

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 subitemsChanged()

Emits when the list of subitems changed.

void changed()

Emits when some data changed.

Private Functions

ActionMain()
class ActionManageSavedSettings : public sh::actions::ActionActionItem
#include <actionmanagesavedsettings.h>

Action for opening the ‘Manage saved settings’ dialog.

Public Functions

ActionManageSavedSettings()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionNumberFileviews : public sh::actions::SubmenuActionItem
#include <actionnumberfileviews.h>

Submenu action for changing the number of fileviews.

Public Functions

ActionNumberFileviews()
const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems()

Returns the list of subitems from this submenu.

void setSubitems(const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems)

Sets the subitems.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void subitemsChanged()

Emits when the list of subitems changed.

void changed()

Emits when some data changed.

Friends

friend class ActionNumberFileviews_Add
friend class ActionNumberFileviews_Remove
friend class ActionNumberFileviews_Remove_Current
class ActionNumberFileviews_Add : public sh::actions::ActionActionItem
#include <actionnumberfileviews.h>

Action for adding a new fileview.

Public Functions

ActionNumberFileviews_Add(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes = {})
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void doInitialize()
void doShutdown()
class ActionNumberFileviews_Remove : public sh::actions::ActionActionItem
#include <actionnumberfileviews.h>

Action for removing a certain fileview.

Public Functions

ActionNumberFileviews_Remove(int i, bool deflt)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionNumberFileviews_Remove_Current : public sh::actions::ActionActionItem
#include <actionnumberfileviews.h>

Action for removing the current fileview (for keyboard shortcut).

Public Functions

ActionNumberFileviews_Remove_Current(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void doInitialize()
void doShutdown()
class ActionQuit : public sh::actions::ActionActionItem
#include <actionquit.h>

Action for closing Shallot.

Public Functions

ActionQuit()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionRefresh : public sh::actions::ActionActionItem
#include <actionrefresh.h>

Action for refreshing the current view.

Public Functions

ActionRefresh()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionSaveSettings : public sh::actions::ActionActionItem
#include <actionsavesettings.h>

Action for opening the ‘Save settings’ dialog.

Public Functions

ActionSaveSettings()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionSearch : public sh::actions::ActionActionItem
#include <actionsearch.h>

Action for opening the ‘Save settings’ dialog.

Public Functions

ActionSearch()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionSelectAllNodes : public sh::actions::mainmenu::ActionAbstractSelectNodes
#include <actionselect.h>

Action for selecting all nodes in the current file view.

Public Functions

ActionSelectAllNodes()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionSetWindowTitlePattern : public sh::actions::ActionActionItem
#include <actionsetwindowtitlepattern.h>

Action for setting the window title pattern.

Public Functions

ActionSetWindowTitlePattern()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionShowDetailPanel : public sh::actions::ActionActionItem
#include <actionshowdetailpanel.h>

Action for toggling the visibility of the detail panel.

Public Functions

ActionShowDetailPanel()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionShowFolderTree : public sh::actions::ActionActionItem
#include <actionshowfoldertree.h>

Action for toggling the visibility of the directory tree.

Public Functions

ActionShowFolderTree()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionShowLog : public sh::actions::ActionActionItem
#include <actionshowlog.h>

Action for showing the Shallot log in a dialog.

Public Functions

ActionShowLog()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionTreeStickyness : public sh::actions::ActionActionItem
#include <actiontreestickyness.h>

Action for toggling the stickyness of the directory tree to the fileviews.

Public Functions

ActionTreeStickyness()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionTuning : public sh::actions::ActionActionItem
#include <actiontuning.h>

Action for opening the ‘Tuning’ dialog.

Public Functions

ActionTuning()
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

namespace base

Core logic.

Includes common data structures and some basic infrastructure. Some other namespaces in sh contain parts of the infrastructure as well.

Enums

enum LogSeverity

The severity of a log message.

Values:

enumerator DEBUG = 0
enumerator INFO = 100
enumerator _DEFAULT = INFO
enumerator WARNING = 200
enumerator ERROR = 300
enumerator E_RROR = ERROR
class IconManager : public QObject, public sh::base::Singleton
#include <iconmanager.h>

Fetches icons according to theme availability and settings.

Public Functions

QIcon getIcon(QString mainname, QString emblemname = QString(), QString miniemblemname = QString(), QStringList tags = QStringList())

Creates a QIcon from the icon name(s). Uses a cache.

QIcon getIconByFullname(QString fullname)

Creates a QIcon from the icon fullname. Uses a cache.

QIcon getIcon(QIcon mainicon, QString emblemname, QString miniemblemname, QStringList tags)

Creates a QIcon based on an existing one. Uncached.

QPixmap getPixmap(QString name, int size = 22)

Creates a QPixmap for an icon name. Uncached.

~IconManager()
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

IconManager()
QIcon _getIcon(QString name)
QImage _colourImage(QImage img, QColor color)

Private Members

QMutex cachemutex
QHash<QString, QIcon> cache
QList<GetIconStrategy*> getIconStrategies
std::shared_ptr<sh::configuration::ConfigurationValue> cfgvalPreferredStrategy
class GetIconStrategy

Subclassed by sh::base::IconManager::IncludedGetIconStrategy, sh::base::IconManager::QIconFromThemeGetIconStrategy

Public Functions

QIcon getIcon(QString name) = 0
~GetIconStrategy()
class IncludedGetIconStrategy : public sh::base::IconManager::GetIconStrategy

Public Functions

IncludedGetIconStrategy()
QIcon getIcon(QString name)

Private Members

QColor brandingcolor1
QColor brandingcolor2
class QIconFromThemeGetIconStrategy : public sh::base::IconManager::GetIconStrategy

Public Functions

QIconFromThemeGetIconStrategy()
QIcon getIcon(QString name)

Private Members

QHash<QString, QString> _aliases
class Logger : public QObject, public sh::base::Singleton
#include <logger.h>

The logging manager.

Use it for writing messages to the Shallot log and for reading from it.

Note: Logging is easiest by the LOG_* macros like SH_LOG_INFO (and it provides more meta data!).

Public Functions

void logException(sh::exceptions::Exception &ex, LogSeverity severity = LogSeverity::ERROR, QString source = QString())

Logs an exception.

void log(QString message, LogSeverity severity, QString source = QString())

Logs a message.

QString getLogAsText(LogSeverity minseverity = LogSeverity::DEBUG)

Returns all logged messages as one text.

QList<LogMessage*> logMessages()

Returns the list of logged messages.

QString logPrefix()

Returns the log prefix, i.e. an optional string all log output begins with.

~Logger()
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 newLogMessageArrived()

Emitted when a new log message was written.

Private Functions

Logger()

Private Members

QMutex mutex
QList<LogMessage*> _logMessages
QString _logPrefix
struct LogMessage
#include <logger.h>

A single log message.

Public Members

QString message
LogSeverity severity
QString source
QDateTime time
class MainThread
#include <mainthread.h>

The main thread.

Lots of data structure may only accessed from the main thread. The UI and the sh::filesystem::FilesystemModel also live in this thread (although some functions there may allow multi-threading in some ways).

Public Static Functions

sh::base::ThreadDispatcher *dispatcher()

The sh::base::ThreadDispatcher, which allows to execute code in the main thread.

class ShallotProcess : public sh::base::Singleton
#include <shallotprocess.h>

Provides parameters given from the user by command line and some more simple infos.

Public Functions

QString uiMode()

The ui mode (e.g. “qt”, “web”) specified on command line.

QMap<QString, QString> configurationValueAssignments()

The configuration value assignments set on command line.

QList<QString> configurationValueFiles()

The configuration value files set on command line.

QString parameterValue(QString key, QString deflt = QString())

Returns the command line parameter value for a key as string.

QStringList parameterValueList(QString key)

Returns the command line parameter value for a key as list of strings (for multiple parameter usage).

qint64 parameterValueInt(QString key, qint64 deflt = 0)

Returns the command line parameter value for a key as integer.

QStringList parameters()

Returns the list of keys of all specified command line parameter names.

QString initialWorkDirectory()

Returns the initial directory specified on command line.

QString logPrefix()

Returns the log prefix (i.e. an optional string all log output begins with) specified on command line.

QStringList lang()

Returns the ui language specified on command line.

QColor brandingColor()

Returns the Shallot branding color (typically a dark red).

int minport()

Return the minimal allowed port specified on command line (for web ui).

int maxport()

Return the maximal allowed port specified on command line (for web ui).

int workerminport()

Return the minimal allowed port specified on command line for spawing web workers with (for web ui).

int workermaxport()

Return the maximal allowed port specified on command line for spawing web workers with (for web ui).

int maxnumberworkers(int deflt)

Maximum number of workers specified on command line.

int maxnumberworkersperhost(int deflt)

Maximum number of workers per host specified on command line.

int maxmemorypercent(int deflt)

Maximum memory in percent specified on command line.

int maxmemorypercentglobal(int deflt)

Maximum memory in percent globally specified on command line.

int maxbrowserawayseconds(int deflt)

Maximum browser away time in seconds specified on command line.

int maxidlenessseconds(int deflt)

Maximum user idleness time in seconds specified on command line.

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 Functions

QString userDataDir()

Returns the path to a storage for per-user data. It resides somewhere within the user home directory.

QString shallotDataDir()

Returns the directory of the Shallot program data. It contains the static files which are part of the Shallot program.

QString revisionString()

Returns the Shallot revision string, i.e. the exact version number. Note: This is only updated by a special build tool (anise) and not by directly compiling via qmake.

QString homepage()

Returns the url to the Shallot homepage.

QDateTime buildtime()

Returns the time when this Shallot build was created. Note: This is only updated by a special build tool (anise) and not by directly compiling via qmake.

Private Functions

ShallotProcess()

Private Members

QMutex _brandingcolormutex
QMap<QString, QStringList> _cmdlineargs
QString _workdir
QString _ui
QMap<QString, QString> _cfgvalassignments
QList<QString> _cfgvalfiles
QColor _brandingcolor
std::shared_ptr<sh::configuration::ConfigurationValue> cfgvalBrandingColor
int _minport = 0
int _maxport = 0
int _workerminport = 0
int _workermaxport = 0
class Singleton
#include <singletoninitializer.h>

A singleton with initialization on Shallot startup and shutdown in the end.

See SingletonInitializer.

Subclassed by sh::actions::ActionsManager, sh::actions::mainmenu::ActionMain, sh::base::IconManager, sh::base::Logger, sh::base::ShallotProcess, sh::configuration::ConfigurationManager, sh::detailcolumns::DetailColumnCustomAttributes, sh::detailcolumns::DetailColumnDirectSymlinkTarget, sh::detailcolumns::DetailColumnExtendedAttributes, sh::detailcolumns::DetailColumnFilesize, sh::detailcolumns::DetailColumnMimetype, sh::detailcolumns::DetailColumnMtime, sh::detailcolumns::DetailColumnResolvedSymlink, sh::exceptions::ExceptionHandlerSettingsManager, sh::filesystem::FilesystemHandlerRegister, sh::filesystem::FilesystemModel, sh::filesystem::FilesystemModelDirectoryTreeProxy, sh::filesystem::FilesystemModelDirectoryTreeProxyVisibilityEnforcements, sh::filesystemhandlers::GnomeIODevicesFilesystemHandler, sh::filesystemhandlers::GnomeIONetworkFilesystemHandler, sh::filesystemhandlers::GnomeIOSmbFilesystemHandler, sh::filesystemhandlers::LocalFilesystemHandler, sh::filesystemhandlers::SharcFilesystemHandler, sh::paneldetails::PanelDetailManager, sh::scripting::api::ApiGlobalObject, sh::scripting::PythonScriptInterpreter, sh::scripting::ScriptingEngine, sh::search::SearchFilesystemHandler, sh::search::SearchManager, sh::settings::SettingsManager, sh::tools::accounts::AccountsManager, sh::tools::Benchmarking, sh::tools::BookmarkManager, sh::tools::DataExchange, sh::tools::filetypes::FileTypeManager, sh::tools::filetypes::UserDefinedOpenMethodDeterminationStrategy, sh::tools::LocalFilesystemWatcher, sh::tools::LocalFilesystemWatcherConnector, sh::tools::OperationsCache, sh::tools::ThumbnailManager, sh::tools::VisibleViews

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).

~Singleton()
Singleton(const Singleton&) = delete
Singleton(Singleton&&) = delete

Private Members

QMutex _mutex_shutdown
bool _shutdown = false
class SingletonInitializer
#include <singletoninitializer.h>

Takes care of initialization and shutdown of infrastructure singletons.

It is a very early part of shallot core infrastructure. Singletons typically participate by using those macros:

DECLARE_SINGLETON(STYPE): Used inside the singleton class definition. STYPE is the singleton’s class. It must be a subclass of sh::base::Singleton. It will get a static std::shared_ptr<STYPE> instance() method by that.

REGISTER_SINGLETON(NS, STYPE, GROUPNAME): Used inside the source file. NS is the namespace of the singleton. STYPE is the singleton’s class. GROUPNAME is the singleton group name (used for dependency handling, see later).

For singleton groups, there is REGISTER_SINGLETON_GROUP(GROUPNAME, ...): GROUPNAME is the group name used for grouping singletons together. Additional arguments are other group names; those groups are considered as dependencies, which must be fulfilled before this group can.

For just initializing stuff via static methods (without a singleton instance), use REGISTER_STATICINIT(NS, STYPE, GROUPNAME): NS is the namespace of the class to initialize. STYPE is the class to initialize. It must provide public static void doInitialize() and static void doShutdown(). GROUPNAME is the group name.

Public Functions

void callInitializers()

Executes all create-callbacks at first, then all init-callbacks. In both runs, the callbacks with lower index come first. Afterwards, the singletons are considered as up and running.

SingletonInitializer()

Constructed only by the infrastructure and made available otherwise.

~SingletonInitializer()
void shutdown()

Executes all shutdown-callbacks at first, then all remove-callbacks. The callback order is the reversed one of callInitializers. Afterwards, the singletons are considered as shut down and removed.

Public Static Functions

char registerGroup(QString groupname, QStringList groupdeps)

Registers a singleton group.

You should typically use REGISTER_SINGLETON_GROUP. See SingletonInitializer.

char registerSingleton(QString name, std::function<std::shared_ptr<Singleton>()> instancefctQString groupname, )

Registers a singleton.

You should typically use DECLARE_SINGLETON and REGISTER_SINGLETON. See SingletonInitializer.

QThread *initializerThread()
bool isShutdown()

If the singletons are completely shut down and removed.

Private Types

std::tuple< QString, QString, std::function< std::shared_ptr< Singleton >)> > SingletonTuple
typedef std::tuple<QString, QStringList> SingletonGroupTuple

Private Static Functions

bool dependsOn(QString group, QString depgroup)

Private Static Attributes

QList<SingletonTuple> *_singletons
QHash<QString, SingletonGroupTuple> *_groups
bool _isshutdown = false
QMutex shutdownmutex
class ThreadDispatcher : public QObject
#include <threaddispatcher.h>

Dispatcher for sync/async invocation of functions into the associated thread.

Public Functions

ThreadDispatcher(QObject *parent, QThread *thread)

Constructed only by the infrastructure and made available otherwise.

void invokeSync(std::function<void()>)

Synchronously executes a function in the dispatcher’s thread.

If it already runs in the current thread, it just executes the function. It returns when the function is completely executed.

void invokeAsync(std::function<void()>)

Asynchronously executes a function in the dispatcher’s thread.

It directly returns. The actual execution will take place in a later message loop iteration of that thread.

void invokeAsync(std::function<void()>std::shared_ptr<void> obj1, std::shared_ptr<void> obj2 = 0, std::shared_ptr<void> obj3 = 0, )

Like the other variant, but it can also conserve some shared pointers until after execution.

bool inThread()

Returns if the current thread is already equal to the dispatcher’s thread (so dispatching isn’t required).

Signals

void _invoked()

Private Functions

void _invokeAsync(std::function<void()>)

Private Members

QMutex callsmutex
QThread *_thread
QQueue<std::function<void()>> _queue

Private Slots

void slot_invoked()
class ThreadPool : public QObject
#include <threadpool.h>

A pool of worker threads doing some short jobs from a queue.

Public Static Functions

void enqueueForce(std::function<void()> fct)

Enqueues code to the threadpool.

void enqueueForce(std::function<void()> fctstd::shared_ptr<void> obj1, std::shared_ptr<void> obj2 = 0, std::shared_ptr<void> obj3 = 0, )

Enqueues code to the threadpool.

It can also conserve some shared pointers until after execution.

void enqueueForceBeyondAsyncCallBarrier(std::function<void()> fctstd::shared_ptr<void> obj1 = 0, std::shared_ptr<void> obj2 = 0, std::shared_ptr<void> obj3 = 0, )

Enqueues code to the threadpool and forbids async calls within it. This is useful for ensuring that no code might access a certain object after its deletion.

It can also conserve some shared pointers until after execution.

void enqueueIfIn(std::function<void()> fctQThread *thread, )

Enqueues code to the threadpool if currently in thread. Otherwise executes directly.

void enqueueIfInMain(std::function<void()> fct)

Enqueues code to the threadpool if currently in main thread. Otherwise executes directly.

void doShutdown()

Only called by the Shallot infrastructure for shutdown.

bool isShuttingDown()
bool isShutdown()
int getThreadCount()
void respectThreadAbort()
void doInitialize()

Private Static Functions

void _enqueueForce(std::function<void()> fct)

Private Static Attributes

const int THREAD_COUNT = 10
QMutex poolmutex
QWaitCondition pooladdedcondition
QList<std::function<void()>> tasks
bool _shutsdown = false
QList<ThreadPoolThread*> _threads
int _threadsalive = 0

Friends

friend class ThreadPoolThread
class ThreadPoolThread : public QThread
#include <threadpool.h>

A thread in the thread pool.

Friends

friend class ThreadPool
namespace configuration

Configuration, so everything you see in ‘Finetuning’, and some other data (e.g. get shallot program directory).

Enums

enum ConfigurationCategory

Categories of Configursh::configuration::ConfigurationValuentations. They are used for grouping them in the dialogs. There is no difference in behavior implied by this choice.

Values:

enumerator CategoryNone = 0

No category.

enumerator CategoryGUI = 1

User interface category.

enumerator CategoryBehavior = 2

Behavioral configuration category.

enumerator CategoryExternalTools = 3

External tools category.

class ConfigurationManager : public QObject, public sh::base::Singleton
#include <configurationmanager.h>

Manages the Shallot configuration.

This is the more static part of Shallot. Much more stuff, i.e. everything you see in ‘Manage saved settings’, is in sh::settings::SettingsManager.

Public Functions

std::shared_ptr<ConfigurationValue> registerConfigValue(QString name, QVariant deflt, ConfigurationValueType *valuetype = 0, QString desc = "", ConfigurationCategory cat = CategoryNone, QString longdesc = "", QString changehint = "")

Creates and registers a new ConfigurationValue. This is typically done once at the beginning. Each registered instance is shown in the ‘Tuning’ dialog and can be set (for making changes) and observed (for applying changes) in code as well. Useful e.g. for some internal bookkeeping or for exotic machine-wide configuration values (path to some tool, …).

QList<std::shared_ptr<ConfigurationValue>> getAllConfigurationValues()

Returns a list of all registered configuration value instances.

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

QVariant getFixedConfigValue(QString key)

Returns a non-null value if ‘key’ was set in a fixed way (e.g. via command line).

ConfigurationManager()

Private Members

QHash<QString, std::shared_ptr<ConfigurationValue>> _configvalues
QHash<QString, QVariant> _fixed_configvalues
bool _fixed_configvalues_initialized = false
QMutex _mutex
class ConfigurationValueImpl : public sh::configuration::ConfigurationValue

Public Functions

ConfigurationValueImpl(QString name, QVariant deflt, QString desc, QString longdesc, ConfigurationCategory cat, ConfigurationValueType *valuetype, QString changehint, ConfigurationManager *mgr)
void setConfigValue(QVariant value) override

Sets a new configuration value.

QVariant getConfigValueVariant() override

Returns the current value of this instance as variant.

bool mayChange() override

Returns if changes are allowed.

int getConfigValueInt()

Returns the current value of this instance as integer.

double getConfigValueFloat()

Returns the current value of this instance as floating point number.

bool getConfigValueBool()

Returns the current value of this instance as boolean.

QString getConfigValueString()

Returns the current value of this instance as string.

void consumeValue(QObject *o, std::function<void()> h)

Adds a consumer function, triggered directly and whenever the value changes.

Parameters
  • o: For lifetime monitoring.

QString name()

Returns the internal name of this configuration.

QString description()

Returns the short description of this configuration.

QString longDescription()

Returns the long description of this configuration.

ConfigurationCategory category()

Returns the category of this configuration (mainly for UI structuring).

QString changeHint()

Returns the change hint text of this configuration.

QVariant defaultValue()

Returns the default value of this configuration.

ConfigurationValueType *valueType()

Returns the value type of this configuration.

Public Static Functions

ConfigurationValueType *valueTypeString()

Returns the string type for configuration values.

ConfigurationValueType *valueTypeInteger()

Returns the integer type for configuration values.

ConfigurationValueType *valueTypeFloat()

Returns the floating point number type for configuration values.

ConfigurationValueType *valueTypeBoolean()

Returns the boolean type for configuration values.

ConfigurationValueType *valueTypeLocalFilePath()

Returns the filepath type for configuration values.

Private Members

ConfigurationManager *mgr
class ConfigurationValue
#include <configurationvalue.h>

Abstract base class for a configuration value which is managed in the Tuning dialog.

Each instance can get and set the value associated to it.

You should typically not need to override it. See sh::configuration::ConfigurationManager. See Shallot documentation for more details.

Subclassed by sh::configuration::ConfigurationManager::ConfigurationValueImpl

Public Functions

ConfigurationValue(QString name, QVariant deflt, QString desc, QString longdesc, ConfigurationCategory cat, ConfigurationValueType *valuetype, QString changehint)
int getConfigValueInt()

Returns the current value of this instance as integer.

double getConfigValueFloat()

Returns the current value of this instance as floating point number.

bool getConfigValueBool()

Returns the current value of this instance as boolean.

QString getConfigValueString()

Returns the current value of this instance as string.

QVariant getConfigValueVariant() = 0

Returns the current value of this instance as variant.

void setConfigValue(QVariant value) = 0

Sets a new configuration value.

bool mayChange() = 0

Returns if changes are allowed.

void consumeValue(QObject *o, std::function<void()> h)

Adds a consumer function, triggered directly and whenever the value changes.

Parameters
  • o: For lifetime monitoring.

QString name()

Returns the internal name of this configuration.

QString description()

Returns the short description of this configuration.

QString longDescription()

Returns the long description of this configuration.

ConfigurationCategory category()

Returns the category of this configuration (mainly for UI structuring).

QString changeHint()

Returns the change hint text of this configuration.

QVariant defaultValue()

Returns the default value of this configuration.

ConfigurationValueType *valueType()

Returns the value type of this configuration.

Public Static Functions

ConfigurationValueType *valueTypeString()

Returns the string type for configuration values.

ConfigurationValueType *valueTypeInteger()

Returns the integer type for configuration values.

ConfigurationValueType *valueTypeFloat()

Returns the floating point number type for configuration values.

ConfigurationValueType *valueTypeBoolean()

Returns the boolean type for configuration values.

ConfigurationValueType *valueTypeLocalFilePath()

Returns the filepath type for configuration values.

Friends

friend class ConfigurationManager
friend class ConfigurationValueType
class ConfigurationValueType
#include <configurationvaluetype.h>

Abstract base class for a configuration value type.

Each subclass implements support for a certain type of configuration values (e.g. string, integer, …).

Subclassed by sh::configuration::ConfigurationValueTypeBoolean, sh::configuration::ConfigurationValueTypeFloat, sh::configuration::ConfigurationValueTypeInteger, sh::configuration::ConfigurationValueTypeLocalFilePath, sh::configuration::ConfigurationValueTypeString

Public Functions

QString valueDescription(QVariant v)
QVariant parse(QString input)
class ConfigurationValueTypeBoolean : public sh::configuration::ConfigurationValueType
#include <configurationvaluetype.h>

Configuration value type ‘boolean’.

Public Functions

QString valueDescription(QVariant v)
QVariant parse(QString input)
class ConfigurationValueTypeFloat : public sh::configuration::ConfigurationValueType
#include <configurationvaluetype.h>

Configuration value type ‘float’.

Public Functions

QString valueDescription(QVariant v)
QVariant parse(QString input)
class ConfigurationValueTypeInteger : public sh::configuration::ConfigurationValueType
#include <configurationvaluetype.h>

Configuration value type ‘integer’.

Public Functions

QString valueDescription(QVariant v)
QVariant parse(QString input)
class ConfigurationValueTypeLocalFilePath : public sh::configuration::ConfigurationValueType
#include <configurationvaluetype.h>

Configuration value type ‘file path’.

Public Functions

QString valueDescription(QVariant v)
QVariant parse(QString input)
class ConfigurationValueTypeString : public sh::configuration::ConfigurationValueType
#include <configurationvaluetype.h>

Configuration value type ‘string’.

Public Functions

QString valueDescription(QVariant v)
QVariant parse(QString input)
namespace detailcolumns

Implementations of detail columns.

Subclasses of sh::filesystem::DetailColumn (and possibly some auxiliary stuff). They are shown in the fileviews and can be queried in code.

class DetailColumnCustomAttributes : public sh::filesystem::DetailColumn, public sh::base::Singleton
#include <detailcolumncustomattributes.h>

Detail column which determines the custom attributes.

Custom attributes are filesystem handler specific values about files (like permissions).

Public Functions

void applyValueByEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::Operation *op, QVariant value) override
QString name()

The internal unique name.

QString displayName()

The display name.

bool isValueAvailable(std::shared_ptr<FilesystemNode> node)

Checks if a value for this detail is available for one given node.

QVariant value(std::shared_ptr<FilesystemNode> node, bool ignoreAged = false)

Returns the value for this detail for one given node.

Parameters
  • ignoreAged: If no value should be returned which is older than the last request (not useful for nearly all cases).

QString displayValue(std::shared_ptr<FilesystemNode> node, const sh::filesystem::FilesystemModelFileviewProxy *viewmodel)

Returns the stringified value for this details for one given node considering the configuration of a view.

QVariant requestValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op = 0, bool withNodeValues = false, bool withOperationsCache = true)

Requests to determine the value for this detail for one given node. Blocks until the value is available. Get it with the value method afterwards.

bool sort_doTypediff()

If sorting should separate files and directories.

int sort_order(std::shared_ptr<FilesystemNode> n1, std::shared_ptr<FilesystemNode> n2)

The sorting order.

uint displayIndex()

Controls which place this column should get in the user interface.

QVariant computeValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op)

Returns a freshly determined value for this column and the given node. It neither asks nor populates any caches or storages.

int defaultWidth()
bool isRightAligned()
void applyValueByEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given eurl (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

void applyValueByNode(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given node (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

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 Functions

QMap<QString, QString> getMapByValue(QVariant val)

Converts the QVariant(QString) from native detail column representation to a QString/QString map.

QVariant VALUE_UNAVAILABLE()

A special value expressing that the value is not yet available.

void registerKnownDetailColumn(QString name, std::shared_ptr<DetailColumn> column)
std::shared_ptr<DetailColumn> findKnownDetailColumn(QString name)

Public Static Attributes

const uint DISPLAYINDEX_CORE = 10000
const uint DISPLAYINDEX_INTERESTING = 20000
const uint DISPLAYINDEX_EXOTIC = 30000

Private Functions

DetailColumnCustomAttributes()
class DetailColumnDirectSymlinkTarget : public sh::filesystem::DetailColumn, public sh::base::Singleton
#include <detailcolumndirectsymlinktarget.h>

Detail column which determines the direct symlink target (by resolving a link once).

Public Functions

QString name()

The internal unique name.

QString displayName()

The display name.

bool isValueAvailable(std::shared_ptr<FilesystemNode> node)

Checks if a value for this detail is available for one given node.

QVariant value(std::shared_ptr<FilesystemNode> node, bool ignoreAged = false)

Returns the value for this detail for one given node.

Parameters
  • ignoreAged: If no value should be returned which is older than the last request (not useful for nearly all cases).

QString displayValue(std::shared_ptr<FilesystemNode> node, const sh::filesystem::FilesystemModelFileviewProxy *viewmodel)

Returns the stringified value for this details for one given node considering the configuration of a view.

QVariant requestValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op = 0, bool withNodeValues = false, bool withOperationsCache = true)

Requests to determine the value for this detail for one given node. Blocks until the value is available. Get it with the value method afterwards.

bool sort_doTypediff()

If sorting should separate files and directories.

int sort_order(std::shared_ptr<FilesystemNode> n1, std::shared_ptr<FilesystemNode> n2)

The sorting order.

uint displayIndex()

Controls which place this column should get in the user interface.

QVariant computeValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op)

Returns a freshly determined value for this column and the given node. It neither asks nor populates any caches or storages.

int defaultWidth()
bool isRightAligned()
void applyValueByEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given eurl (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

void applyValueByNode(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given node (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

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 Functions

QVariant VALUE_UNAVAILABLE()

A special value expressing that the value is not yet available.

void registerKnownDetailColumn(QString name, std::shared_ptr<DetailColumn> column)
std::shared_ptr<DetailColumn> findKnownDetailColumn(QString name)

Public Static Attributes

const uint DISPLAYINDEX_CORE = 10000
const uint DISPLAYINDEX_INTERESTING = 20000
const uint DISPLAYINDEX_EXOTIC = 30000

Private Functions

DetailColumnDirectSymlinkTarget()
class DetailColumnExtendedAttributes : public sh::filesystem::DetailColumn, public sh::base::Singleton
#include <detailcolumnextendedattributes.h>

Detail column which determines the extended attributes.

Extended attributes are a feature of some filesystems.

Public Functions

void applyValueByEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::Operation *op, QVariant value) override
QString name()

The internal unique name.

QString displayName()

The display name.

bool isValueAvailable(std::shared_ptr<FilesystemNode> node)

Checks if a value for this detail is available for one given node.

QVariant value(std::shared_ptr<FilesystemNode> node, bool ignoreAged = false)

Returns the value for this detail for one given node.

Parameters
  • ignoreAged: If no value should be returned which is older than the last request (not useful for nearly all cases).

QString displayValue(std::shared_ptr<FilesystemNode> node, const sh::filesystem::FilesystemModelFileviewProxy *viewmodel)

Returns the stringified value for this details for one given node considering the configuration of a view.

QVariant requestValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op = 0, bool withNodeValues = false, bool withOperationsCache = true)

Requests to determine the value for this detail for one given node. Blocks until the value is available. Get it with the value method afterwards.

bool sort_doTypediff()

If sorting should separate files and directories.

int sort_order(std::shared_ptr<FilesystemNode> n1, std::shared_ptr<FilesystemNode> n2)

The sorting order.

uint displayIndex()

Controls which place this column should get in the user interface.

QVariant computeValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op)

Returns a freshly determined value for this column and the given node. It neither asks nor populates any caches or storages.

int defaultWidth()
bool isRightAligned()
void applyValueByEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given eurl (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

void applyValueByNode(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given node (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

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 Functions

QMap<QString, QByteArray> getMapByValue(QVariant val)

Converts the QVariant(QString) from native detail column representation to a QString/QString map.

QVariant VALUE_UNAVAILABLE()

A special value expressing that the value is not yet available.

void registerKnownDetailColumn(QString name, std::shared_ptr<DetailColumn> column)
std::shared_ptr<DetailColumn> findKnownDetailColumn(QString name)

Public Static Attributes

const uint DISPLAYINDEX_CORE = 10000
const uint DISPLAYINDEX_INTERESTING = 20000
const uint DISPLAYINDEX_EXOTIC = 30000

Private Functions

DetailColumnExtendedAttributes()
class DetailColumnFilesize : public sh::filesystem::DetailColumn, public sh::base::Singleton
#include <detailcolumnfilesize.h>

Detail column which determines the file size.

Public Functions

QString name()

The internal unique name.

QString displayName()

The display name.

bool isValueAvailable(std::shared_ptr<FilesystemNode> node)

Checks if a value for this detail is available for one given node.

QVariant value(std::shared_ptr<FilesystemNode> node, bool ignoreAged = false)

Returns the value for this detail for one given node.

Parameters
  • ignoreAged: If no value should be returned which is older than the last request (not useful for nearly all cases).

bool isVisible()

If this detail shall be a visible column in the view.

QVariant requestValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op = 0, bool withNodeValues = false, bool withOperationsCache = true)

Requests to determine the value for this detail for one given node. Blocks until the value is available. Get it with the value method afterwards.

bool sort_doTypediff()

If sorting should separate files and directories.

int sort_order(std::shared_ptr<FilesystemNode> n1, std::shared_ptr<FilesystemNode> n2)

The sorting order.

uint displayIndex()

Controls which place this column should get in the user interface.

QVariant computeValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op)

Returns a freshly determined value for this column and the given node. It neither asks nor populates any caches or storages.

int defaultWidth()
bool isRightAligned()
void applyValueByEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given eurl (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

void applyValueByNode(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given node (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

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 Functions

QVariant VALUE_UNAVAILABLE()

A special value expressing that the value is not yet available.

void registerKnownDetailColumn(QString name, std::shared_ptr<DetailColumn> column)
std::shared_ptr<DetailColumn> findKnownDetailColumn(QString name)

Public Static Attributes

const uint DISPLAYINDEX_CORE = 10000
const uint DISPLAYINDEX_INTERESTING = 20000
const uint DISPLAYINDEX_EXOTIC = 30000

Private Functions

DetailColumnFilesize()
class DetailColumnMimetype : public sh::filesystem::DetailColumn, public sh::base::Singleton
#include <detailcolumnmimetype.h>

Detail column which determines the file’s mimetype.

Public Functions

QString name()

The internal unique name.

QString displayName()

The display name.

bool isValueAvailable(std::shared_ptr<FilesystemNode> node)

Checks if a value for this detail is available for one given node.

QVariant value(std::shared_ptr<FilesystemNode> node, bool ignoreAged = false)

Returns the value for this detail for one given node.

Parameters
  • ignoreAged: If no value should be returned which is older than the last request (not useful for nearly all cases).

bool isVisible()

If this detail shall be a visible column in the view.

QVariant requestValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op = 0, bool withNodeValues = false, bool withOperationsCache = true)

Requests to determine the value for this detail for one given node. Blocks until the value is available. Get it with the value method afterwards.

bool sort_doTypediff()

If sorting should separate files and directories.

int sort_order(std::shared_ptr<FilesystemNode> n1, std::shared_ptr<FilesystemNode> n2)

The sorting order.

uint displayIndex()

Controls which place this column should get in the user interface.

QVariant computeValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op)

Returns a freshly determined value for this column and the given node. It neither asks nor populates any caches or storages.

int defaultWidth()
bool isRightAligned()
void applyValueByEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given eurl (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

void applyValueByNode(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given node (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

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 Functions

QVariant VALUE_UNAVAILABLE()

A special value expressing that the value is not yet available.

void registerKnownDetailColumn(QString name, std::shared_ptr<DetailColumn> column)
std::shared_ptr<DetailColumn> findKnownDetailColumn(QString name)

Public Static Attributes

const uint DISPLAYINDEX_CORE = 10000
const uint DISPLAYINDEX_INTERESTING = 20000
const uint DISPLAYINDEX_EXOTIC = 30000

Private Functions

DetailColumnMimetype()
class DetailColumnMtime : public sh::filesystem::DetailColumn, public sh::base::Singleton
#include <detailcolumnmtime.h>

Detail column which determines the file’s modification time.

Public Functions

void applyValueByEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::Operation *op, QVariant value) override
QString name()

The internal unique name.

QString displayName()

The display name.

bool isValueAvailable(std::shared_ptr<FilesystemNode> node)

Checks if a value for this detail is available for one given node.

QVariant value(std::shared_ptr<FilesystemNode> node, bool ignoreAged = false)

Returns the value for this detail for one given node.

Parameters
  • ignoreAged: If no value should be returned which is older than the last request (not useful for nearly all cases).

bool isVisible()

If this detail shall be a visible column in the view.

QVariant requestValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op = 0, bool withNodeValues = false, bool withOperationsCache = true)

Requests to determine the value for this detail for one given node. Blocks until the value is available. Get it with the value method afterwards.

bool sort_doTypediff()

If sorting should separate files and directories.

int sort_order(std::shared_ptr<FilesystemNode> n1, std::shared_ptr<FilesystemNode> n2)

The sorting order.

uint displayIndex()

Controls which place this column should get in the user interface.

QVariant computeValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op)

Returns a freshly determined value for this column and the given node. It neither asks nor populates any caches or storages.

int defaultWidth()
bool isRightAligned()
void applyValueByEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given eurl (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

void applyValueByNode(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given node (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

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 Functions

QVariant VALUE_UNAVAILABLE()

A special value expressing that the value is not yet available.

void registerKnownDetailColumn(QString name, std::shared_ptr<DetailColumn> column)
std::shared_ptr<DetailColumn> findKnownDetailColumn(QString name)

Public Static Attributes

const uint DISPLAYINDEX_CORE = 10000
const uint DISPLAYINDEX_INTERESTING = 20000
const uint DISPLAYINDEX_EXOTIC = 30000

Private Functions

DetailColumnMtime()
class DetailColumnResolvedSymlink : public sh::filesystem::DetailColumn, public sh::base::Singleton
#include <detailcolumnresolvedsymlink.h>

Detail column which determines the symlink target (by resolving links recursively).

This detail column has some active behavior. It informs the filesystem model about the ‘buddy nodes’.

Public Functions

QString name()

The internal unique name.

QString displayName()

The display name.

bool isValueAvailable(std::shared_ptr<FilesystemNode> node)

Checks if a value for this detail is available for one given node.

QVariant value(std::shared_ptr<FilesystemNode> node, bool ignoreAged = false)

Returns the value for this detail for one given node.

Parameters
  • ignoreAged: If no value should be returned which is older than the last request (not useful for nearly all cases).

QVariant requestValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op = 0, bool withNodeValues = false, bool withOperationsCache = true)

Requests to determine the value for this detail for one given node. Blocks until the value is available. Get it with the value method afterwards.

bool sort_doTypediff()

If sorting should separate files and directories.

int sort_order(std::shared_ptr<FilesystemNode> n1, std::shared_ptr<FilesystemNode> n2)

The sorting order.

uint displayIndex()

Controls which place this column should get in the user interface.

QVariant computeValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op)

Returns a freshly determined value for this column and the given node. It neither asks nor populates any caches or storages.

int defaultWidth()
bool isRightAligned()
void applyValueByEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given eurl (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

void applyValueByNode(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given node (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

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 Functions

QVariant VALUE_UNAVAILABLE()

A special value expressing that the value is not yet available.

void registerKnownDetailColumn(QString name, std::shared_ptr<DetailColumn> column)
std::shared_ptr<DetailColumn> findKnownDetailColumn(QString name)

Public Static Attributes

const uint DISPLAYINDEX_CORE = 10000
const uint DISPLAYINDEX_INTERESTING = 20000
const uint DISPLAYINDEX_EXOTIC = 30000

Private Functions

DetailColumnResolvedSymlink()
namespace exceptions

Exceptions.

The class hierarchy of Shallot exceptions as well as some utilities for exception handling.

Enums

enum ExecuteGuardFlag

Values:

enumerator MANUAL_RETRY_ENABLED = 1 << 0
enumerator AUTOMATIC_RETRY_ENABLED = 1 << 1
enumerator LOGGING_DISABLED = 1 << 2
enumerator RESUMEABLE_PROGRAM_ERROR_END_WITH_USER_FEEDBACK_HERE = 1 << 3
enumerator CANCELABLE_UP_TO_HERE = 1 << 4
enumerator ALL_ERRORS_KILL_SHALLOT = 1 << 5
enumerator IGNORE_ALL_RESUMEABLE_ERRORS_SILENTLY = 1 << 6
class ArgumentException : public sh::exceptions::ProgramException
#include <argumentexception.h>

Shallot exception for failed operation due to invalid arguments given to some program part. It typically allows resume but not retry (special cases may override each of them).

Subclassed by sh::filesystem::EurlMisformattedException

Public Functions

ArgumentException(ExceptionData data)
QString message() const
QString name() const
QString classes() const
QString details() const
QString callstack() const
QString auxiliary() const
QString customValue(QString key) const
bool isRuntimeException() const
bool isProgramException() const
bool isRetryable() const
bool isResumeable() const
bool isDetailsAreInteresting() const
int autoRetryRecommendedIn() const
void setResumeable(bool v)
void setReTryable(bool v)
void setCustomValue(QString key, QString value)
bool isClass(QString classname)
sh::exceptions::ExceptionData data()

Public Static Functions

template<class Handler>
std::shared_ptr<RegisterHandler<Handler>> createRegisterHandler(Handler handler, QStack<Handler> *stack)
void executeGuarded(std::function<void()> fctint flags = 0, )

Executes some code with some standard exection handling around.

Parameters
  • fct: The code to execute guarded.

  • flags: Flags of ExecuteGuardFlag for choosing the behavior.

void executeGuarded_errorpanel(std::function<void()> fctint flags = 0, )
QString _demangle(QString l)
void exceptionDialog(sh::exceptions::Exception &e, bool *doRetry)

Public Static Attributes

const QString UNDEFINED_ERROR_OCCURRED = QObject::tr("An unspecified error occurred.")
const QString SHALLOT_MUST_CLOSE_TEXT = QObject::tr("Your Shallot process is disturbed by an error and needs to be closed now. You can try if starting Shallot again solves the issue. If you are interested in technical details, please take a look at the log.")
const QString Value_isShallotException = "_isShallotException"
class CancelException
#include <exception.h>

A special exception for cancellation of some action on user behalf.

A very special exception outside of the hierarchy. It is only used by the infrastructure; never throw it directly.

Public Functions

CancelException()
class Exception
#include <exception.h>

Shallot exception base class. Also contains some static methods for general work with exceptions.

Subclassed by sh::exceptions::ProgramException, sh::exceptions::RuntimeException, sh::scripting::ScriptingEngine::ScriptedException

Public Functions

QString message() const
QString name() const
QString classes() const
QString details() const
QString callstack() const
QString auxiliary() const
QString customValue(QString key) const
bool isRuntimeException() const
bool isProgramException() const
bool isRetryable() const
bool isResumeable() const
bool isDetailsAreInteresting() const
int autoRetryRecommendedIn() const
void setResumeable(bool v)
void setReTryable(bool v)
void setCustomValue(QString key, QString value)
bool isClass(QString classname)
Exception(ExceptionData data)
Exception()
sh::exceptions::ExceptionData data()

Public Static Functions

template<class Handler>
std::shared_ptr<RegisterHandler<Handler>> createRegisterHandler(Handler handler, QStack<Handler> *stack)
void executeGuarded(std::function<void()> fctint flags = 0, )

Executes some code with some standard exection handling around.

Parameters
  • fct: The code to execute guarded.

  • flags: Flags of ExecuteGuardFlag for choosing the behavior.

void executeGuarded_errorpanel(std::function<void()> fctint flags = 0, )
QString _demangle(QString l)
void exceptionDialog(sh::exceptions::Exception &e, bool *doRetry)

Public Static Attributes

const QString UNDEFINED_ERROR_OCCURRED = QObject::tr("An unspecified error occurred.")
const QString SHALLOT_MUST_CLOSE_TEXT = QObject::tr("Your Shallot process is disturbed by an error and needs to be closed now. You can try if starting Shallot again solves the issue. If you are interested in technical details, please take a look at the log.")
const QString Value_isShallotException = "_isShallotException"

Private Static Functions

void exceptionDialog(QString error1, QString error2, QString details, QString icon, bool mayRetry, bool mayClose, bool mayCancel, bool showLoglabelAndDetails, bool *doRetry)

Private Static Attributes

bool _inShutdown = false
QMutex _inShutdownMutex
class HandlerSettings
#include <exception.h>

Public Members

QString cancelText
QStack<std::function<bool(sh::exceptions::Exception&)>> exceptionHandler_retryable
QStack<std::function<void(sh::exceptions::Exception&)>> exceptionHandler_resumeable
QStack<std::function<void(sh::exceptions::Exception&)>> exceptionHandler_hard
QStack<std::function<void()>> exceptionHandler_cancel

Private Functions

HandlerSettings()

Friends

friend class ExceptionHandlerSettingsManager
template<class Handler>
class RegisterHandler
#include <exception.h>

Public Functions

RegisterHandler(Handler handler, QStack<Handler> *stack)
~RegisterHandler()

Private Members

QStack<Handler> *_stack
class ExceptionData : public QMap<QString, QString>
#include <exception.h>

Used for specifying metadata for a sh::exceptions::Exception.

Public Functions

ExceptionData(const ExceptionData &o)
ExceptionData(const QMap<QString, QString> &o)
ExceptionData()
ExceptionData name(QString name)
ExceptionData classes(QString classes)
ExceptionData aux(QString aux)
ExceptionData details(QString details)
ExceptionData message(QString message)
ExceptionData runtime()
ExceptionData program()
ExceptionData retryable(bool v = true)
ExceptionData resumeable(bool v = true)
ExceptionData autoRetryRecommended(int v = -1)
ExceptionData detailsAreInteresting(bool v = true)
class ExceptionHandlerSettingsManager : public sh::base::Singleton
#include <exception.h>

Managing how to default-handle unhandled exceptions.

Public Functions

Exception::HandlerSettings *handlerSettings()

Returns the current Exception::HandlerSettings.

~ExceptionHandlerSettingsManager()
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

ExceptionHandlerSettingsManager()

Private Members

QMap<QThread*, Exception::HandlerSettings*> _handlerSettings
QMutex _mutex
class IOException : public sh::exceptions::RuntimeException
#include <ioexception.h>

Shallot exception in IO. It allows resume and typically allows retry (special cases may override each of them).

Subclassed by sh::exceptions::PermissionDeniedException, sh::filesystem::Operation::MaxAllowedSizeRatioPerPartExceededException

Public Functions

IOException(ExceptionData data)
QString message() const
QString name() const
QString classes() const
QString details() const
QString callstack() const
QString auxiliary() const
QString customValue(QString key) const
bool isRuntimeException() const
bool isProgramException() const
bool isRetryable() const
bool isResumeable() const
bool isDetailsAreInteresting() const
int autoRetryRecommendedIn() const
void setResumeable(bool v)
void setReTryable(bool v)
void setCustomValue(QString key, QString value)
bool isClass(QString classname)
sh::exceptions::ExceptionData data()

Public Static Functions

template<class Handler>
std::shared_ptr<RegisterHandler<Handler>> createRegisterHandler(Handler handler, QStack<Handler> *stack)
void executeGuarded(std::function<void()> fctint flags = 0, )

Executes some code with some standard exection handling around.

Parameters
  • fct: The code to execute guarded.

  • flags: Flags of ExecuteGuardFlag for choosing the behavior.

void executeGuarded_errorpanel(std::function<void()> fctint flags = 0, )
QString _demangle(QString l)
void exceptionDialog(sh::exceptions::Exception &e, bool *doRetry)

Public Static Attributes

const QString UNDEFINED_ERROR_OCCURRED = QObject::tr("An unspecified error occurred.")
const QString SHALLOT_MUST_CLOSE_TEXT = QObject::tr("Your Shallot process is disturbed by an error and needs to be closed now. You can try if starting Shallot again solves the issue. If you are interested in technical details, please take a look at the log.")
const QString Value_isShallotException = "_isShallotException"
class PermissionDeniedException : public sh::exceptions::IOException
#include <permissiondeniedexception.h>

Shallot exception for something forbidden was tried to execute. It allows resume and retry (special cases may override each of them).

Public Functions

PermissionDeniedException(ExceptionData data)
QString message() const
QString name() const
QString classes() const
QString details() const
QString callstack() const
QString auxiliary() const
QString customValue(QString key) const
bool isRuntimeException() const
bool isProgramException() const
bool isRetryable() const
bool isResumeable() const
bool isDetailsAreInteresting() const
int autoRetryRecommendedIn() const
void setResumeable(bool v)
void setReTryable(bool v)
void setCustomValue(QString key, QString value)
bool isClass(QString classname)
sh::exceptions::ExceptionData data()

Public Static Functions

template<class Handler>
std::shared_ptr<RegisterHandler<Handler>> createRegisterHandler(Handler handler, QStack<Handler> *stack)
void executeGuarded(std::function<void()> fctint flags = 0, )

Executes some code with some standard exection handling around.

Parameters
  • fct: The code to execute guarded.

  • flags: Flags of ExecuteGuardFlag for choosing the behavior.

void executeGuarded_errorpanel(std::function<void()> fctint flags = 0, )
QString _demangle(QString l)
void exceptionDialog(sh::exceptions::Exception &e, bool *doRetry)

Public Static Attributes

const QString UNDEFINED_ERROR_OCCURRED = QObject::tr("An unspecified error occurred.")
const QString SHALLOT_MUST_CLOSE_TEXT = QObject::tr("Your Shallot process is disturbed by an error and needs to be closed now. You can try if starting Shallot again solves the issue. If you are interested in technical details, please take a look at the log.")
const QString Value_isShallotException = "_isShallotException"
class ProgramException : public sh::exceptions::Exception
#include <programexception.h>

Shallot exception for internal bugs in Shallot. It optionally allows resume but no retry (special cases may override each of them).

Subclassed by sh::exceptions::ArgumentException, sh::exceptions::ThreadingException

Public Functions

ProgramException(ExceptionData data)
QString message() const
QString name() const
QString classes() const
QString details() const
QString callstack() const
QString auxiliary() const
QString customValue(QString key) const
bool isRuntimeException() const
bool isProgramException() const
bool isRetryable() const
bool isResumeable() const
bool isDetailsAreInteresting() const
int autoRetryRecommendedIn() const
void setResumeable(bool v)
void setReTryable(bool v)
void setCustomValue(QString key, QString value)
bool isClass(QString classname)
sh::exceptions::ExceptionData data()

Public Static Functions

template<class Handler>
std::shared_ptr<RegisterHandler<Handler>> createRegisterHandler(Handler handler, QStack<Handler> *stack)
void executeGuarded(std::function<void()> fctint flags = 0, )

Executes some code with some standard exection handling around.

Parameters
  • fct: The code to execute guarded.

  • flags: Flags of ExecuteGuardFlag for choosing the behavior.

void executeGuarded_errorpanel(std::function<void()> fctint flags = 0, )
QString _demangle(QString l)
void exceptionDialog(sh::exceptions::Exception &e, bool *doRetry)

Public Static Attributes

const QString UNDEFINED_ERROR_OCCURRED = QObject::tr("An unspecified error occurred.")
const QString SHALLOT_MUST_CLOSE_TEXT = QObject::tr("Your Shallot process is disturbed by an error and needs to be closed now. You can try if starting Shallot again solves the issue. If you are interested in technical details, please take a look at the log.")
const QString Value_isShallotException = "_isShallotException"
class RuntimeException : public sh::exceptions::Exception
#include <runtimeexception.h>

Shallot exception for failed operation due to (often external) runtime effects. It allows resume and optionally allows retry (special cases may override each of them).

Subclassed by sh::exceptions::IOException

Public Functions

RuntimeException(ExceptionData data)
QString message() const
QString name() const
QString classes() const
QString details() const
QString callstack() const
QString auxiliary() const
QString customValue(QString key) const
bool isRuntimeException() const
bool isProgramException() const
bool isRetryable() const
bool isResumeable() const
bool isDetailsAreInteresting() const
int autoRetryRecommendedIn() const
void setResumeable(bool v)
void setReTryable(bool v)
void setCustomValue(QString key, QString value)
bool isClass(QString classname)
sh::exceptions::ExceptionData data()

Public Static Functions

template<class Handler>
std::shared_ptr<RegisterHandler<Handler>> createRegisterHandler(Handler handler, QStack<Handler> *stack)
void executeGuarded(std::function<void()> fctint flags = 0, )

Executes some code with some standard exection handling around.

Parameters
  • fct: The code to execute guarded.

  • flags: Flags of ExecuteGuardFlag for choosing the behavior.

void executeGuarded_errorpanel(std::function<void()> fctint flags = 0, )
QString _demangle(QString l)
void exceptionDialog(sh::exceptions::Exception &e, bool *doRetry)

Public Static Attributes

const QString UNDEFINED_ERROR_OCCURRED = QObject::tr("An unspecified error occurred.")
const QString SHALLOT_MUST_CLOSE_TEXT = QObject::tr("Your Shallot process is disturbed by an error and needs to be closed now. You can try if starting Shallot again solves the issue. If you are interested in technical details, please take a look at the log.")
const QString Value_isShallotException = "_isShallotException"
class ThreadAbortException
#include <exception.h>

Only used by the infrastructure; never throw it directly.

Public Functions

ThreadAbortException()
class ThreadingException : public sh::exceptions::ProgramException
#include <threadingexception.h>

Shallot exception for misuse of threading (e.g. wrong caller thread). It does not allow resume (special cases may override each of them).

Public Functions

ThreadingException(ExceptionData data)
QString message() const
QString name() const
QString classes() const
QString details() const
QString callstack() const
QString auxiliary() const
QString customValue(QString key) const
bool isRuntimeException() const
bool isProgramException() const
bool isRetryable() const
bool isResumeable() const
bool isDetailsAreInteresting() const
int autoRetryRecommendedIn() const
void setResumeable(bool v)
void setReTryable(bool v)
void setCustomValue(QString key, QString value)
bool isClass(QString classname)
sh::exceptions::ExceptionData data()

Public Static Functions

template<class Handler>
std::shared_ptr<RegisterHandler<Handler>> createRegisterHandler(Handler handler, QStack<Handler> *stack)
void executeGuarded(std::function<void()> fctint flags = 0, )

Executes some code with some standard exection handling around.

Parameters
  • fct: The code to execute guarded.

  • flags: Flags of ExecuteGuardFlag for choosing the behavior.

void executeGuarded_errorpanel(std::function<void()> fctint flags = 0, )
QString _demangle(QString l)
void exceptionDialog(sh::exceptions::Exception &e, bool *doRetry)

Public Static Attributes

const QString UNDEFINED_ERROR_OCCURRED = QObject::tr("An unspecified error occurred.")
const QString SHALLOT_MUST_CLOSE_TEXT = QObject::tr("Your Shallot process is disturbed by an error and needs to be closed now. You can try if starting Shallot again solves the issue. If you are interested in technical details, please take a look at the log.")
const QString Value_isShallotException = "_isShallotException"
namespace filepropertydialogtabs

Implementations of tabs in a file property dialog.

Subclasses of sh::ui::FilePropertyDialogTab (and possibly some auxiliary stuff). They implement content in file property dialogs.

class FilePropertyDialogTabExtendedAttributes : public sh::ui::FilePropertyDialogTab
#include <filepropertydialogtabextendedattributes.h>

Properties dialog tab for extended attributes.

Public Functions

FilePropertyDialogTabExtendedAttributes()
QString title() override

The tab title. .

QList<QString> properties() override

Returns the list of property labels (one entry for each widget).

Each property is displayed with a header and a widget (created in createWidget) with some content (populated in updateWidget).

void populateWidget(int i, sh::ui::FilePropertyDialogTabActionsView *widget) override

Populates the tab widget for the i-th property.

Typically uses the FilePropertyDialog::create* methods to create sub-widgets.

See also dialog().

void updateWidget(int i, sh::ui::FilePropertyDialogTabActionsView *widget, sh::filesystem::Operation *op) override

Populates the widget for the i-th property with actual content. .

QString titleWithoutMnemonic()

The tab title without mnemonic.

void refresh()

Refreshes the complete content.

Typically called after some user actions in a property widget require that all the other content must be refreshed.

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes()

The nodes to show.

FilePropertyDialogTabActionsView *widgetAt(int i)

Returns the widget for the i-th property.

int widgetCount()

Returns the number of widgets.

std::shared_ptr<FilePropertyDialog> dialog()

Returns the associated dialog.

Public Static Functions

void doInitialize()
void doShutdown()
class FilePropertyDialogTabGeneral : public sh::ui::FilePropertyDialogTab
#include <filepropertydialogtabgeneral.h>

Properties dialog tab for general infos.

Public Functions

FilePropertyDialogTabGeneral()
QString title() override

The tab title. .

QList<QString> properties() override

Returns the list of property labels (one entry for each widget).

Each property is displayed with a header and a widget (created in createWidget) with some content (populated in updateWidget).

void populateWidget(int i, sh::ui::FilePropertyDialogTabActionsView *widget) override

Populates the tab widget for the i-th property.

Typically uses the FilePropertyDialog::create* methods to create sub-widgets.

See also dialog().

void updateWidget(int i, sh::ui::FilePropertyDialogTabActionsView *widget, sh::filesystem::Operation *op) override

Populates the widget for the i-th property with actual content. .

QString titleWithoutMnemonic()

The tab title without mnemonic.

void refresh()

Refreshes the complete content.

Typically called after some user actions in a property widget require that all the other content must be refreshed.

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes()

The nodes to show.

FilePropertyDialogTabActionsView *widgetAt(int i)

Returns the widget for the i-th property.

int widgetCount()

Returns the number of widgets.

std::shared_ptr<FilePropertyDialog> dialog()

Returns the associated dialog.

Public Static Functions

void doInitialize()
void doShutdown()
class FilePropertyDialogTabUnixPermissions : public sh::ui::FilePropertyDialogTab
#include <filepropertydialogtabunixpermissions.h>

Properties dialog tab for unix permissions.

Public Functions

FilePropertyDialogTabUnixPermissions()
QString title() override

The tab title. .

QList<QString> properties() override

Returns the list of property labels (one entry for each widget).

Each property is displayed with a header and a widget (created in createWidget) with some content (populated in updateWidget).

void populateWidget(int i, sh::ui::FilePropertyDialogTabActionsView *widget) override

Populates the tab widget for the i-th property.

Typically uses the FilePropertyDialog::create* methods to create sub-widgets.

See also dialog().

void updateWidget(int i, sh::ui::FilePropertyDialogTabActionsView *widget, sh::filesystem::Operation *op) override

Populates the widget for the i-th property with actual content. .

QString titleWithoutMnemonic()

The tab title without mnemonic.

void refresh()

Refreshes the complete content.

Typically called after some user actions in a property widget require that all the other content must be refreshed.

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes()

The nodes to show.

FilePropertyDialogTabActionsView *widgetAt(int i)

Returns the widget for the i-th property.

int widgetCount()

Returns the number of widgets.

std::shared_ptr<FilePropertyDialog> dialog()

Returns the associated dialog.

Public Static Functions

QString getUserName(int uid)
QString getGroupName(int gid)
QMap<int, QString> getAllUsers()
QMap<int, QString> getAllGroups()
void doInitialize()
void doShutdown()

Private Functions

void slot_buttontriggered(int i)
QString userPermissionsDescription(int flags, int rflag, int wflag, int xflag)
class ActionChange : public sh::actions::ActionActionItem

Public Functions

ActionChange(std::shared_ptr<sh::filepropertydialogtabs::FilePropertyDialogTabUnixPermissions> tab)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class FilePropertyDialogTabWindows : public sh::ui::FilePropertyDialogTab
#include <filepropertydialogtabwindows.h>

Properties dialog tab for unix permissions.

Public Functions

QString title() = 0

The tab title. .

QString titleWithoutMnemonic()

The tab title without mnemonic.

QList<QString> properties() = 0

Returns the list of property labels (one entry for each widget).

Each property is displayed with a header and a widget (created in createWidget) with some content (populated in updateWidget).

void populateWidget(int i, FilePropertyDialogTabActionsView *widget) = 0

Populates the tab widget for the i-th property.

Typically uses the FilePropertyDialog::create* methods to create sub-widgets.

See also dialog().

void updateWidget(int i, FilePropertyDialogTabActionsView *widget, sh::filesystem::Operation *op) = 0

Populates the widget for the i-th property with actual content. .

void refresh()

Refreshes the complete content.

Typically called after some user actions in a property widget require that all the other content must be refreshed.

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes()

The nodes to show.

FilePropertyDialogTabActionsView *widgetAt(int i)

Returns the widget for the i-th property.

int widgetCount()

Returns the number of widgets.

std::shared_ptr<FilePropertyDialog> dialog()

Returns the associated dialog.

namespace filesystem

Filesystem model and auxiliary logic.

Enums

enum SizeFormatting

Values:

enumerator SizeFormattingModePrefixes
enumerator SizeFormattingModePlainBytes
enum FilesystemNodeType

Enumeration of types a sh::filesystem::FilesystemNode can have.

Values:

enumerator NONE = 0

No type specified or does not exist.

enumerator File = 1

Usual file.

enumerator FIRSTTYPE = File

The first type (used for generating int ranges).

enumerator Directory

Directory.

enumerator Link

Link.

enumerator Unknown

Unknown.

enumerator LASTPHYSICALTYPE = Unknown

The last physical type, excluding internal magic types (used for generating int ranges).

enumerator SpecialTreeOnlyDirectory

Special kind of directory which behaves differently.

enumerator Invalid

This return type means that the type can’t be determined. It should not occur in typical situations.

enumerator LASTTYPE = SpecialTreeOnlyDirectory

The last type (used for generating int ranges).

class AdhocFilesystemNodeList : public sh::filesystem::FilesystemNodeList
#include <filesystemnodelist.h>

This FilesystemNodeList subclass is used for spontanously fetching a fresh list of node children.

Node additions and removals will not touch the model.

Node instances inside it will be deleted together with this list.

Public Functions

AdhocFilesystemNodeList()

Is intended to be directly constructed from everywhere.

~AdhocFilesystemNodeList()
void addItems(QSet<std::shared_ptr<FilesystemNode>> nodes)
void addItem(std::shared_ptr<FilesystemNode> node)
void removeItems(QSet<std::shared_ptr<FilesystemNode>> nodes)
void removeItem(std::shared_ptr<FilesystemNode> node)
void resetItems(sh::filesystem::FilesystemNodeType type, QSet<std::shared_ptr<FilesystemNode>> nodes)
std::shared_ptr<FilesystemNode> mynode()

Returns the node which owns this children list. The result may be 0 for non model-backed lists.

void addItems(QSet<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) = 0

Adds items to this list. In a model-backed list, this triggers the internal model mounting calls. It is not allowed to call this method twice with the same node.

void addItem(std::shared_ptr<sh::filesystem::FilesystemNode> node) = 0

Adds an item to this list. In a model-backed list, this triggers the internal model mounting calls. It is not allowed to call this method twice with the same node.

void removeItems(QSet<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) = 0

Removes nodes from this list. In a model-backed list, this triggers the internal model unmounting calls. It is not allowed to call this method with a node, which is not contained in that list.

void removeItem(std::shared_ptr<sh::filesystem::FilesystemNode> node) = 0

Removes a node from this list. In a model-backed list, this triggers the internal model unmounting calls. It is not allowed to call this method with a node, which is not contained in that list.

void resetItems(sh::filesystem::FilesystemNodeType type, QSet<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) = 0

Resets the list for a given node type to a given new list of children nodes.

bool contains(std::shared_ptr<FilesystemNode> node)

Checks if this list contains a given node.

const QList<std::shared_ptr<sh::filesystem::FilesystemNode>> *nodes()

Returns the list of nodes currently stored in this instance.

class DetailColumn : public std::enable_shared_from_this<DetailColumn>
#include <detailcolumn.h>

Abstract base class for a detail column (on filesystem nodes).

Those can e.g. be seen in the file list view, but can also be queried internally by other places in code.

It encapsulates the retrieval logic and metadata for one piece of additional information a sh::filesystem::FilesystemNode can have (e.g. the filesize). Retrieving the values is designed to be asynchronous. Each instance represents one column, while the actual logic is implemented in subclasses. For a new detail column, subclass this class and implement at least determineValue.

Subclassed by sh::detailcolumns::DetailColumnCustomAttributes, sh::detailcolumns::DetailColumnDirectSymlinkTarget, sh::detailcolumns::DetailColumnExtendedAttributes, sh::detailcolumns::DetailColumnFilesize, sh::detailcolumns::DetailColumnMimetype, sh::detailcolumns::DetailColumnMtime, sh::detailcolumns::DetailColumnResolvedSymlink, sh::filesystemhandlers::SharcFilesystemHandler::ArchivedSizeDetailColumn, sh::scripting::api::ApiDetailColumn

Public Functions

QString name()

The internal unique name.

QString displayName()

The display name.

bool isValueAvailable(std::shared_ptr<FilesystemNode> node)

Checks if a value for this detail is available for one given node.

QVariant value(std::shared_ptr<FilesystemNode> node, bool ignoreAged = false)

Returns the value for this detail for one given node.

Parameters
  • ignoreAged: If no value should be returned which is older than the last request (not useful for nearly all cases).

QString displayValue(std::shared_ptr<FilesystemNode> node, const sh::filesystem::FilesystemModelFileviewProxy *viewmodel)

Returns the stringified value for this details for one given node considering the configuration of a view.

bool isVisible()

If this detail shall be a visible column in the view.

QVariant requestValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op = 0, bool withNodeValues = false, bool withOperationsCache = true)

Requests to determine the value for this detail for one given node. Blocks until the value is available. Get it with the value method afterwards.

bool sort_doTypediff()

If sorting should separate files and directories.

int sort_order(std::shared_ptr<FilesystemNode> n1, std::shared_ptr<FilesystemNode> n2)

The sorting order.

uint displayIndex()

Controls which place this column should get in the user interface.

QVariant computeValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op)

Returns a freshly determined value for this column and the given node. It neither asks nor populates any caches or storages.

int defaultWidth()
bool isRightAligned()
~DetailColumn()
void applyValueByEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given eurl (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

void applyValueByNode(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given node (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

Public Static Functions

QVariant VALUE_UNAVAILABLE()

A special value expressing that the value is not yet available.

void registerKnownDetailColumn(QString name, std::shared_ptr<DetailColumn> column)
std::shared_ptr<DetailColumn> findKnownDetailColumn(QString name)

Public Static Attributes

const uint DISPLAYINDEX_CORE = 10000
const uint DISPLAYINDEX_INTERESTING = 20000
const uint DISPLAYINDEX_EXOTIC = 30000

Private Members

QString _displayName
QString _name
uint _displayIndex
bool _sort_doTypediff
int _defaultWidth
bool _isRightAligned

Private Static Attributes

QMap<QString, std::shared_ptr<DetailColumn>> _knownDetailColumns
QMutex _knownDetailColumnsMutex

Friends

friend class sh::filesystem::FilesystemNode
class Eurl : public std::enable_shared_from_this<Eurl>
#include <eurl.h>

Filesystem paths.

A Extended Uniform Resource Locator is something like a URL.

It is more general since it can also be nested. It is something like zip:/[]//zippedfolder/zippedfile.

You get Eurl instances only from the factory methods. There will never be two instances with the same textual value.

Please note: Instances can be associated with any kind of elements in the filesystem (files, directories, links, …). It might also point to something which does not exist at all. The documentation sometimes explicitly makes a difference between those kinds (files, directories, links, …; often called ‘node type’). But it often uses the term ‘file’ implicitly while meaning all kinds of elements; assuming that e.g. a directory is just a special kind of a file. It should be clear from the particular context which meaning applies.

Public Functions

QString asString() const

Returns the textual value. This is what Eurl.fromString would expect as parameter.

QString hostname() const

Returns the hostname part (from the outer url of this Eurl). Examples: "livingroom-pc" for smb://livingroom-pc/foo/bar/baz. "" for .

QString path() const

Returns the path part (from the outer url of this Eurl). Examples: "/foo/bar/baz" for smb://livingroom-pc/foo/bar/baz. "/foo/bar/baz" for . "/" for .

QString basename() const

Returns the last path segment. This is the text behind the last slash. Examples: "baz" for . "" for .

QString scheme() const

Returns the scheme (from the outer url of this shallot.Eurl). This is what comes before the ://. Example: "file" for .

std::shared_ptr<const Eurl> outerUrl() const

Returns a new Eurl containing only the outer part of this one (strips the embeddings). Example: foobar://host/foo/bar/baz for foobar:/[zip:/[]//d/e]//foo/bar/baz.

std::shared_ptr<const Eurl> outermostInnerEurl() const

Returns a new Eurl containing only the embedding of this one. Example: zip:/[]//d/e for foobar:/[zip:/[]//d/e]//foo/bar/baz.

std::shared_ptr<const Eurl> withAppendedSegment(QString basename) const

Returns a new Eurl from this one with “/basename” appended. The parameter is assumed to be a single path segment.

std::shared_ptr<const Eurl> withAppendedSegments(QString path) const

Returns a new Eurl with path segments “/pa/t/h/” appended. The parameter may contain "/"s for dividing path segments.

std::shared_ptr<const Eurl> root() const

Returns the root Eurl from this one. Example: zip:/[]// for zip:/[]//foo/bar/baz.

std::shared_ptr<const Eurl> enwrapWithOuterUrl(QString scheme, QString hostname, QString path) const

Returns a new Eurl containing this one packed as embedding and new outer parts scheme, hostname and path. Example: scheme:/[]/hostname/p/a/t/h for .

std::shared_ptr<const Eurl> parentSegment() const

Returns the parent Eurl. At first, this traverses path segments. For a root path eurl with embeddings, it returns the embedding. If none are available, it returns 0. Examples: foo://host/foo for foo://host/foo/bar. foo://host/ for foo://host/boo. foo:/[bar://host/goo]/anotherhost/ for foo:/[bar://host/goo]/anotherhost/boo. bar://host/foo for foo:/[bar://host/foo]/host/. 0 for foo://host/.

bool hasInnerUrls() const

Checks if this Eurl has embeddings. Examples: true for foo:/[bar:///foo]/host/. false for foo://host/.

bool outerUrlIsRootDirectory() const

Checks if this Eurl is a root path (with or without embeddings). Examples: true for foo://host/. false for foo://host/a. true for foo:/[bar:///goo]/host/. false for foo:/[bar:///goo]/host/a. true for foo:/[bar:///goo]//. false for foo:/[bar:///goo]//a.

bool hasParentSegment() const

Checks if this Eurl has a parent segment. This indicates if Eurl.parentSegment would return 0.

bool isPrefixOf(std::shared_ptr<const Eurl> longer) const

Checks if this Eurl is a prefix of another one. This is not an equivalent to a string comparison but it checks parent relationships according to Eurl.parentSegment.

Eurl(QString eurlstring)

Constructed only by the infrastructure and made available otherwise.

~Eurl()

Public Static Functions

std::shared_ptr<const Eurl> fromString(QString eurlstring)

Constructs a new Eurl by string (what Eurl.asString would return).

std::shared_ptr<const Eurl> create(QString scheme, QString hostname, QString path)

Constructs a new Eurl by scheme name, hostname and a path.

std::shared_ptr<const Eurl> create(QString scheme, const Eurl *inner, QString hostname, QString path)

Constructs a new Eurl by scheme name, an inner eurl, a hostname and a path.

void filenameCheck(QString filename)

Checks if a name is a valid filename. If not, EurlMisformattedException is thrown.

void doInitialize()
void doShutdown()

Public Static Attributes

const QChar WRAPPER_BEGIN = '['

The character marking the begin of an embedding.

const QChar WRAPPER_END = ']'

The character marking the end of an embedding.

const QString FORBIDDEN_FILENAME_CHARACTERS = QString("/")

Characters which are forbidden in filenames.

Private Members

const QString _eurlstring
std::shared_ptr<const Eurl> _cache_parentsegment = 0
std::shared_ptr<const Eurl> _cache_outerurl = 0
bool _cache_outerurl_isthis = false
std::shared_ptr<const Eurl> _cache_outermostinnereurl = 0
std::shared_ptr<const Eurl> _cache_root = 0
bool _cache_root_isthis = false
QString _cache_basename
QString _cache_hostname
QString _cache_path
QString _cache_scheme

Private Static Functions

QString check_scheme(QString scheme)
QString check_inner(QString inner)
QString check_hostname(QString hostname)
QString check_path(QString path)
QString check_filename(QString filename)
QString _escape(QString s)
QString _unescape(QString s)
std::shared_ptr<const Eurl> createNOCHECK(QString scheme, const Eurl *inner, QString hostname, QString path)
std::shared_ptr<const Eurl> fromStringNOCHECK(QString eurlstring)

Private Static Attributes

QHash<QChar, QString> _escapemap
QMutex _escapemapmutex
QMutex _mutex
QHash<QString, std::weak_ptr<const Eurl>> _eurluniverse
class EurlMisformattedException : public sh::exceptions::ArgumentException
#include <eurl.h>

Shallot exception for invalid input in Eurl creation methods.

Public Functions

EurlMisformattedException(sh::exceptions::ExceptionData data)
QString message() const
QString name() const
QString classes() const
QString details() const
QString callstack() const
QString auxiliary() const
QString customValue(QString key) const
bool isRuntimeException() const
bool isProgramException() const
bool isRetryable() const
bool isResumeable() const
bool isDetailsAreInteresting() const
int autoRetryRecommendedIn() const
void setResumeable(bool v)
void setReTryable(bool v)
void setCustomValue(QString key, QString value)
bool isClass(QString classname)
sh::exceptions::ExceptionData data()

Public Static Functions

template<class Handler>
std::shared_ptr<RegisterHandler<Handler>> createRegisterHandler(Handler handler, QStack<Handler> *stack)
void executeGuarded(std::function<void()> fctint flags = 0, )

Executes some code with some standard exection handling around.

Parameters
  • fct: The code to execute guarded.

  • flags: Flags of ExecuteGuardFlag for choosing the behavior.

void executeGuarded_errorpanel(std::function<void()> fctint flags = 0, )
QString _demangle(QString l)
void exceptionDialog(sh::exceptions::Exception &e, bool *doRetry)

Public Static Attributes

const QString UNDEFINED_ERROR_OCCURRED = QObject::tr("An unspecified error occurred.")
const QString SHALLOT_MUST_CLOSE_TEXT = QObject::tr("Your Shallot process is disturbed by an error and needs to be closed now. You can try if starting Shallot again solves the issue. If you are interested in technical details, please take a look at the log.")
const QString Value_isShallotException = "_isShallotException"
class FilesystemHandler : public QObject
#include <filesystemhandler.h>

Abstract base class for a custom filesystem handler.

Subclass and register it for implementing a new virtual filesystem, which lets new nodes appear somewhere in the filesystem tree and controls how to handle them.

Use sh::filesystem::FilesystemHandlerRegister for registration.

For executing some actions or checks on a filesystem, you should not use those handlers directly, but the higher-level sh::filesystem::FilesystemOperation class.

Subclassed by sh::filesystemhandlers::ArchiveFilesystemHandler, sh::filesystemhandlers::GnomeIOFilesystemHandler, sh::filesystemhandlers::LocalFilesystemHandler, sh::filesystemhandlers::SharcFilesystemHandler, sh::scripting::api::ApiFilesystemHandler, sh::search::SearchFilesystemHandler

Public Functions

FilesystemHandler(sh::filesystem::FilesystemModel *model)

Is (for subclasses) intended to be directly constructed and registered once.

~FilesystemHandler()
void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list) = 0

Determine a list of subelements in a certain directory.

void configureItems(sh::filesystem::Operation *op, QList<std::shared_ptr<FilesystemNode>> nodes)

Configure newly created nodes (e.g. setting another icon or changing the display name).

sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine if a file is regular, or a dir, or a link, …

qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the size of a file.

QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the mtime of a file.

void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time) = 0

Set the mtime of a file.

QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine mime type of a file.

QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Resolve a link.

QList<QString> listExtendedAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Fetches the list of available extended attributes for an entry.

quint64 getExtendedAttributeSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the site of value for one extended attribute for an entry.

QByteArray getExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the value for one extended attribute for an entry.

void setExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QByteArray value)

Sets the value for one extended attribute for an entry.

void removeExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Removes one extended attributes for an entry.

QMap<QString, QString> getCustomAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Returns the custom attributes for an entry.

In contrast to extended attributes, the custom attributes are not directly stored in the filesystem this way, but handle implementation specific aspects (like permissions).

void setCustomAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QString value)

Sets the value for one custom attribute for an entry.

See also getCustomAttributes.

bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to get the content of a certain file.

std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Get the content of a file.

bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create subdirectories in a certain directory.

void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Create a directory.

bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create a link in a certain directory.

void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target) = 0

Create a link.

bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create files in a certain directory.

void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer) = 0

Creates a file with some content.

It may use handlertransfer for some better integration, like cancel support and progress monitoring.

bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to delete a certain file/directory/link/….

void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Delete a file/directory/link/…

void deleteDirectoryIfEmpty(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Deletes a directory only of it is empty.

bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src) = 0

Returns if it is allowed to rename a certain file, directory, link, … (see renameItem).

void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath) = 0

Renames an item to another path.

It can be a simple filename change or also changes in the deeper path segments.

QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) = 0

Returns a list of actions (see former example) for showing for certain files.

bool requiresResolvedLinks()

Returns if this handler requires to be used by the engine with resolved links.

void viewEnteredDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view entered some directory (e.g. for enabling watchers). See also viewLeftDirectory.

void viewLeftDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view left some directory. See also viewEnteredDirectory.

bool isWellKnownScheme()

Returns if the scheme for this handler is a well known one (which external programs typically would understand).

void search(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>, QList<std::shared_ptr<sh::search::SearchCriterion>>, sh::filesystem::FilesystemNodeType ftype)> addfile, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>)> visitdir, QList<std::shared_ptr<sh::search::SearchCriterion>> criteria, )

Helps searching for files.

Override this method with a behavior identical to the default, if a specialized implementation can be much faster than the default one.

void customizeUi(std::shared_ptr<sh::filesystem::FilesystemNode> node, bool *showSearchPanel)

Creates a custom gui, which becomes part of the fileview.

sh::filesystem::FilesystemModel *model()

A convenience shortcut to the sh::filesystem::FilesystemModel (a singleton).

class HandlerTransfer
#include <filesystemhandler.h>

Subclassed by sh::filesystem::FilesystemOperation::MyHandlerTransfer, sh::filesystem::FilesystemOperationTransfers::SingleStepMonitor

Public Functions

void respectCancel()
void incrementTransferredBytes(qint64 donebytes)
~HandlerTransfer()
class FilesystemHandlerRegister : public QObject, public sh::base::Singleton
#include <filesystemhandlerregister.h>

A register of filesystem handlers.

Each active (i.e. referred to by existing nodes) instance of sh::filesystem::FilesystemHandler must be registered here.

Public Functions

void addHandler(QString scheme, std::shared_ptr<sh::filesystem::FilesystemHandler> handler)

Registers a filesystem handler.

Parameters
  • scheme: The scheme (very first part of a sh::filesystem::Eurl) for which the handler is responsible for.

  • handler: The filesystem handler.

std::shared_ptr<sh::filesystem::FilesystemHandler> findHandler(QString scheme)

Finds a filesystem handler by scheme.

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

FilesystemHandlerRegister()

Private Members

QHash<QString, std::shared_ptr<sh::filesystem::FilesystemHandler>> handlers
QMutex mutex
class FilesystemModel : public QAbstractItemModel, public sh::base::Singleton
#include <filesystemmodel.h>

The filesystem model.

This is the engine which creates and manages sh::filesystem::FilesystemNode nodes. Filesystem nodes are used on many places for all kinds of operations.

Public Functions

std::shared_ptr<sh::filesystem::FilesystemNode> rootNode()

The sh::filesystem::FilesystemNode which is the root node of the entire model. It is the parent for all toplevel nodes.

QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const
Qt::ItemFlags flags(const QModelIndex &index) const
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const
QModelIndex parent(const QModelIndex &index) const
int rowCount(const QModelIndex &parent = QModelIndex()) const
int columnCount(const QModelIndex &parent = QModelIndex()) const
sh::filesystem::FilesystemModelFileviewProxy *createFileviewProxy(QModelIndex root, bool withtooltip, std::function<void(std::shared_ptr<sh::filesystem::FilesystemNode>)> onBecomesInvalid)

Creates a sh::filesystem::FilesystemModelFileviewProxy for presenting the content of a directory.

QList<QPersistentModelIndex> findIndexesForEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Get a list of qt model indexes for a sh::filesystem::Eurl.

If nodes for this eurl are unknown to the model so far, it tries to build them. In typical cases, this list either contains one element, or is empty if the filesystem handlers decide that this file does not exist. But in some cases, there is also more than one index for one sh::filesystem::Eurl (when the sh::filesystem::Eurl appears on more than one place in the tree).

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> findNodesForEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Get a list of sh::filesystem::FilesystemNode for a sh::filesystem::Eurl.

If it is unknown to the model so far, it tries to build them. In typical cases, this list either contains one element, or is empty if the filesystem handlers decide that this file does not exist. But in some cases, there is also more than one node for one sh::filesystem::Eurl (when the sh::filesystem::Eurl appears on more than one place in the tree). It only returns nodes, which are ‘alive’, i.e. which have a living parent and which are a child of this parent.

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> tryGetNodesForEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Returns a list of sh::filesystem::FilesystemNode for a sh::filesystem::Eurl. It only considers the current state of the in-memory model. It will only return nodes which are already known to the model so far. This operation is cheaper and handling only the known nodes is sufficient in many situations. In typical cases, this list either contains one element, or is empty. But in some cases, there is also more than one node for one sh::filesystem::Eurl (when the sh::filesystem::Eurl appears on more than one place in the tree). It only returns nodes, which are ‘alive’, i.e. which have a living parent and which are a child of this parent.

std::shared_ptr<sh::filesystem::FilesystemNode> getNodeForIndex(const QModelIndex index) const

Returns the sh::filesystem::FilesystemNode for a qt model index (in the main model).

QModelIndex getIndexForNode(std::shared_ptr<sh::filesystem::FilesystemNode> node)

Returns a qt model index (in the main model) for a sh::filesystem::FilesystemNode.

std::shared_ptr<sh::filesystem::FilesystemNode> createFilesystemNode(std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemHandler *handler, sh::filesystem::FilesystemNodeType nodetype, bool isHidden, std::shared_ptr<sh::filesystem::FilesystemNode> parent, bool doinsert = true, bool showInitialLoadingLabel = true)

Creates a new sh::filesystem::FilesystemNode for placing it into the model.

If such a node (with the same eurl for the same parent node) does not exist, it generates a new one. If there already is such a node alive, but currently not placed in the model, it recycles this one. This can happen when references exist to a node which is not yet inserted or which is removed meanwhile. It is not allowed to call this method when such a node already exists in the model.

Use this function for getting a sh::filesystem::FilesystemNode, which is to be added to the model now or later. Depending on some parameter values, a call directly adds the node to the filesystem model (not e.g. when doinsert is false or parentnode is 0) It is typically used within a sh::filesystem::FilesystemHandler implementation.

std::shared_ptr<sh::filesystem::FilesystemNode> getOrCreateFilesystemNode(std::shared_ptr<const sh::filesystem::Eurl> neweurl, sh::filesystem::FilesystemHandler *handler, sh::filesystem::FilesystemNodeType nodetype, bool isHidden, std::shared_ptr<sh::filesystem::FilesystemNode> parent, bool doinsert = true, bool showInitialLoadingLabel = true, bool *pIsNew = 0)

Returns a sh::filesystem::FilesystemNode for using it as a child node in the model.

It either creates a new one, if there currently is no node for this eurl in this parentnode, or returns the existing one. Even for existing ones, this call can change the nodetype of that node.

Depending on some parameter values, a call directly adds the node to the filesystem model (not e.g. when doinsert is false or parent is 0).

void refreshData(std::shared_ptr<const sh::filesystem::Eurl> eurl, bool forceFindParent = false, bool withDetails = true)

Request to refresh the internal model information for a sh::filesystem::Eurl. This may be a place which is already known (then a change of some metadata or the removal is detected) or a formerly unknown place (then new nodes get inserted in the model).

void addOpenNodeHelper(int index, std::function<QList<std::shared_ptr<sh::filesystem::FilesystemNode>>(std::shared_ptr<const sh::filesystem::Eurl>)> openNodeHelper)

Registers a helper method for ‘opening’ (mounting, activating, …) locations on demand.

Only used in very rare cases.

~FilesystemModel()
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

FilesystemModel()
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> _findNodesForEurl_helper(std::shared_ptr<const sh::filesystem::Eurl> eurl)
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> openRootEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)
void _subitemFetchingStateChanged(std::shared_ptr<sh::filesystem::FilesystemNode> node, bool value)

Private Members

QList< std::function< QList< std::shared_ptr< sh::filesystem::FilesystemNode > >std::shared_ptr< const sh::filesystem::Eurl >)> > _openNodeHelpers
QMap< int, std::function< QList< std::shared_ptr< sh::filesystem::FilesystemNode > >std::shared_ptr< const sh::filesystem::Eurl >)> > _openNodeHelpersMap
std::shared_ptr<sh::filesystem::FilesystemNode> rootnode
QMutex mutex
QHash<std::shared_ptr<const sh::filesystem::Eurl>, std::weak_ptr<sh::filesystem::FilesystemNode>> eurl2node
QMutex eurl2nodemutex
QMutex _nodeDataMutex
QMutex _openNodeHelpersMutex

Friends

friend class FilesystemNode
friend class LoadOnDemandPlaceholderFilesystemNode
friend class ModelBackedFilesystemNodeList
friend class ::sh::filesystem::DetailColumn
class FilesystemModelDirectoryTreeProxy : public QSortFilterProxyModel, public sh::base::Singleton
#include <filesystemmodeldirectorytreeproxy.h>

A filesystem proxy model for the directory tree.

It has a special sorting and filtering behavior.

Used internally, mostly for the user interface.

Public Functions

void enforceVisibility(std::shared_ptr<FilesystemNode> node)

Marks a node as visible in the directory tree, even if it is a hidden node.

void deEnforceVisibility(std::shared_ptr<FilesystemNode> node)

Unmarks a node for being visible even if hidden (reverses enforceVisibility()).

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

FilesystemModelDirectoryTreeProxy()
class FilesystemModelDirectoryTreeProxyVisibilityEnforcements : public QObject, public sh::base::Singleton
#include <filesystemmodeldirectorytreeproxyvisibilityenforcements.h>

Maintains a list of currently visible directories (i.e. the current one in each view) and controls enforced visibility of them in the directory tree.

Public Functions

void nodeEnteredView(std::shared_ptr<FilesystemNode> node)

Called when a view enters the given directory node.

void nodeLeftView(std::shared_ptr<FilesystemNode> node)

Called when a view leaves the given directory node.

void nodeCollapsedInTree(std::shared_ptr<FilesystemNode> node)

Called when a directory node is collapsed in the directory tree.

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

FilesystemModelDirectoryTreeProxyVisibilityEnforcements()
bool _addenforcement(std::shared_ptr<FilesystemNode> node, std::shared_ptr<FilesystemNode> hnode)

Private Members

QMultiMap<std::shared_ptr<FilesystemNode>, QObject*> _enterednodesrepresentatives
QList<std::tuple<std::weak_ptr<FilesystemNode>, QList<std::shared_ptr<FilesystemNode>>>> hiddenForcedVisibles
class FilesystemModelFileviewProxy : public QSortFilterProxyModel
#include <filesystemmodelfileviewproxy.h>

A filesystem proxy model for a fileview.

It regards the sorting and filtering behavior set up for the connected fileview.

Used internally, mostly for the user interface.

Public Functions

FilesystemModelFileviewProxy(QModelIndex root, bool withtooltip, QObject *parent = 0)

Constructed only indirectly.

void setSizeFormattingMode(SizeFormatting mode)
SizeFormatting getSizeFormattingMode() const
void setHiddenFilesVisible(bool v)
bool getHiddenFilesVisible() const
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const
void triggerReloadData()
void setThumbnail(bool enabled, int size = 32)
bool getThumbnailEnabled()
int getThumbnailSize()
class FilesystemModelSubtreeProxy : public QAbstractItemModel
#include <filesystemmodelsubtreeproxy.h>

A filesystem proxy model for setting a new root node to an existing fileview proxy.

Used internally, mostly for the user interface.

Public Functions

FilesystemModelSubtreeProxy(QModelIndex root, sh::filesystem::FilesystemModelFileviewProxy *upperproxy)

Constructed only indirectly.

QVariant data(const QModelIndex &index, int role) const
Qt::ItemFlags flags(const QModelIndex &index) const
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const
QModelIndex parent(const QModelIndex &index) const
int rowCount(const QModelIndex &parent = QModelIndex()) const
int columnCount(const QModelIndex &parent = QModelIndex()) const
QModelIndex mapFromSource(const QModelIndex mi) const
QModelIndex mapToSource(const QModelIndex mi) const

Signals

void becomesInvalid(std::shared_ptr<sh::filesystem::FilesystemNode> bestValid)

Private Members

bool _inChangeTransaction
std::shared_ptr<sh::filesystem::FilesystemNode> _rootnode
QPersistentModelIndex _rootindex
sh::filesystem::FilesystemModel *mainmodel
sh::filesystem::FilesystemModelFileviewProxy *_upperproxy
class FilesystemNode : public QObject, public std::enable_shared_from_this<FilesystemNode>
#include <filesystemnode.h>

A representation of a location in the filesystem tree.

It represents filesystem nodes like a file or a directory in sh::filesystem::FilesystemModel.

Please note: Instances can be associated with any kind of elements in the filesystem (files, directories, links, …). It might also point to something which does not exist at all (see parentnode). The documentation sometimes explicitly makes a difference between those kinds (files, directories, links, …; often called ‘node type’). But it often uses the term ‘file’ implicitly while meaning all kinds of elements; assuming that e.g. a directory is just a special kind of a file. It should be clear from the particular context which meaning applies.

Subclassed by sh::filesystem::LoadOnDemandPlaceholderFilesystemNode

Public Functions

~FilesystemNode()
std::shared_ptr<const sh::filesystem::Eurl> eurl()

Returns the sh::filesystem::Eurl entry address.

sh::filesystem::FilesystemModel *model()

Convenience shortcut to the sh::filesystem::FilesystemModel.

QString displayName()

Returns the display name (what the user interface displays).

void setDisplayName(QString displayname)

Sets the display name (what the user interface displays).

sh::filesystem::FilesystemHandler *handler()

Returns the handler which is responsible for this node. This should be the same as sh::filesystem::FilesystemHandlerRegister.findHandler(eurl.scheme).

int nodetype()

Returns the FilesystemNodeType node type.

int childnodeCount()

Returns the number of children nodes.

std::shared_ptr<sh::filesystem::FilesystemNode> childnode(int i)

Returns i-th child node.

sh::filesystem::ModelBackedFilesystemNodeList *childnodes()

Returns the list of children.

std::shared_ptr<sh::filesystem::FilesystemNode> parentnode() const

Returns the parent node.

This is 0 if the node does not exist in the model (i.e. not yet inserted or removed afterwards). In most cases, this can be interpreted as ‘file currently does not exist’.

int index()

Returns the index of this node in the parent’s list of children.

void addChild(std::shared_ptr<sh::filesystem::FilesystemNode> node)

Adds a new child. Not allowed to call more than once for a node.

void removeChild(std::shared_ptr<sh::filesystem::FilesystemNode> node)

Removes a new child. Not allowed to call more than once for a node.

bool isFetchingSubitems()

Checks if currently subitems are fetched (i.e. the ‘loading’ node is shown).

QIcon icon()

Returns the node icon.

void setIcon(QIcon icon)

Sets the node icon.

bool isHidden()

Returns if the node is hidden.

Note: It’s not difficult for the user to also show the hidden items.

void setHidden(bool v)

Sets if the node is hidden.

See also isHidden().

void addDetail(std::shared_ptr<sh::filesystem::DetailColumn> column)

Adds a detail to this node.

std::shared_ptr<sh::filesystem::DetailColumn> getDetailColumnByIndex(int index)

Returns the i-th detail column registered to this node.

int getDetailColumnsCount() const

Returns the number of detail columns registered to this node.

bool isRootNode() const

Checks if this is the root node of the model.

bool isConfigured() const

Checks if this node was already configured by a handler.

void requestDetails(bool force = true)

Requests to fetch details for this node.

bool isAlive() const

Checks if this node currently exists in the model.

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> linkDestinationNodes() const

Returns the list of link source nodes. If this node is a link, the link destination nodes may influence the behavior and appearance of this node.

This information does not come from inside but must be set from outside the model implementation.

void setLinkDestinationNodes(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> linkdestinations)

Sets the list of link destination nodes. If this node is a link, the link destination nodes may influence the behavior and appearance of this node.

void requestContainedItems(sh::filesystem::FilesystemNodeType type = FilesystemNodeType::NONE)

Requests to fetch the children of this node with help of the filesystem handler.

FilesystemNode(sh::filesystem::FilesystemModel *model, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString displayname, sh::filesystem::FilesystemHandler *handler, FilesystemNodeType nodetype, bool ishidden)

Constructed only by the infrastructure and made available otherwise.

Signals

void removed()

Is emitted when this node is not placed in the tree anymore. This does not mean the physical deletion of the instance, but just means it is not alive from now on.

void _detailsAvailable()

Is emitted when values for detail columns arrived.

void iconChanged()

Is emitted when the icon changed.

void isHiddenChanged()

Is emitted when the hidden flag changed.

Private Functions

void setDetail(std::shared_ptr<sh::filesystem::DetailColumn> column, QVariant value)
int getInsertPositionForDetailColumn(std::shared_ptr<sh::filesystem::DetailColumn> newCol)

Friends

friend class sh::filesystem::FilesystemModel
friend class sh::filesystem::DetailColumn
friend class LoadOnDemandPlaceholderFilesystemNode
friend class sh::filesystem::FilesystemModelFileviewProxy
friend class sh::filesystem::FilesystemModelSubtreeProxy
friend class sh::filesystem::ModelBackedFilesystemNodeList
class FilesystemNodeList : public QObject
#include <filesystemnodelist.h>

A data structure for children lists of filesystem nodes.

Different subclasses exist with different behaviors and use cases.

Subclassed by sh::filesystem::AdhocFilesystemNodeList, sh::filesystem::ModelBackedFilesystemNodeList

Public Functions

void addItems(QSet<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) = 0

Adds items to this list. In a model-backed list, this triggers the internal model mounting calls. It is not allowed to call this method twice with the same node.

void addItem(std::shared_ptr<sh::filesystem::FilesystemNode> node) = 0

Adds an item to this list. In a model-backed list, this triggers the internal model mounting calls. It is not allowed to call this method twice with the same node.

void removeItems(QSet<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) = 0

Removes nodes from this list. In a model-backed list, this triggers the internal model unmounting calls. It is not allowed to call this method with a node, which is not contained in that list.

void removeItem(std::shared_ptr<sh::filesystem::FilesystemNode> node) = 0

Removes a node from this list. In a model-backed list, this triggers the internal model unmounting calls. It is not allowed to call this method with a node, which is not contained in that list.

void resetItems(sh::filesystem::FilesystemNodeType type, QSet<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) = 0

Resets the list for a given node type to a given new list of children nodes.

std::shared_ptr<sh::filesystem::FilesystemNode> mynode() = 0

Returns the node which owns this children list. The result may be 0 for non model-backed lists.

bool contains(std::shared_ptr<FilesystemNode> node)

Checks if this list contains a given node.

const QList<std::shared_ptr<sh::filesystem::FilesystemNode>> *nodes()

Returns the list of nodes currently stored in this instance.

class FilesystemNodeListEditor
#include <filesystemnodelist.h>

A list editor for easily modifying a FilesystemNodeList.

Mainly used for listing child nodes in sh::filesystem::FilesystemHandler.itemlist. In most cases, you should just use setItems.

Public Functions

FilesystemNodeListEditor(FilesystemNodeList *list, std::shared_ptr<const sh::filesystem::Eurl> parenteurl, sh::filesystem::FilesystemNodeType nodestype)

Constructed only by the infrastructure and made available otherwise.

~FilesystemNodeListEditor()
void setItems(QList<QString> items)

Sets a new list content. This function is all you need in most situations. For iteratively adding nodes, which makes the intermediate results visible in the user interface, see addItem.

void beginIterativeAdding()

Must be called before you begin to iteratively fill the children list (e.g. with addItem). You must also call endIterativeAdding afterwards.

void addItem(QString item)

Adds a new children to the list, directly showing that in the user interface, while you can proceed filling the list. Please read beginIterativeAdding as well! In most cases, you don’t need this function.

std::shared_ptr<FilesystemNode> addCustomItem(std::shared_ptr<const sh::filesystem::Eurl> eurl, QString displayname = QString(), sh::filesystem::FilesystemHandler *handler = 0)

Adds a new children to the list, directly showing that in the user interface, while you can proceed filling the list. Please read beginIterativeAdding as well! In most cases, you don’t need this function.

Note: If you specify a handler, it must be the one matching to eurl’s scheme.

void addExistingNodeItem(std::shared_ptr<sh::filesystem::FilesystemNode> node)

Adds a new children to the list, directly showing that in the user interface, while you can proceed filling the list. Please read beginIterativeAdding as well! In most cases, you don’t need this function.

void endIterativeAdding()

Must be called after you iteratively filled the children list with addItem. This automatically removes all the old nodes, which you haven’t added in this session.

void setItemsAreHosts()

After this call, the addItem method will consider the given names as hostnames instead of new path segments. The resulting sh::filesystem::Eurl will differ accordingly. This only makes sense as children for root eurls.

FilesystemNodeList *rawlist()

Returns the FilesystemNodeList backend. You should rarely need it.

Private Functions

std::shared_ptr<const sh::filesystem::Eurl> getChildEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl, QString item)

Private Members

FilesystemNodeList *_list
std::shared_ptr<const sh::filesystem::Eurl> _parenteurl
sh::filesystem::FilesystemNodeType _nodestype
std::shared_ptr<sh::filesystem::FilesystemNode> _parentnode
sh::filesystem::FilesystemModel *_model
sh::filesystem::FilesystemHandler *_handler
bool _itemsAreHosts = false
bool _beganAddingIteratively = false
QSet<std::shared_ptr<sh::filesystem::FilesystemNode>> _iterativeAddingsBeforeState

Private Static Attributes

QSet<FilesystemNodeList*> _pendingIterativeAddings
QMutex _pendingMutex
QWaitCondition _iterativeAddingPossibleCondition
class FilesystemOperation
#include <filesystemoperation.h>

A high-level interface for filesystem operations.

It is always based on the transaction of a Operation instance (which also gives you access to a FilesystemOperation object).

Some calls optionally allow to give an own instance of sh::filesystem::FilesystemOperationProgressMonitor for some additional functionality. Please note that not all calls provide all those functionality (some do not use e.g. the conflict resolution at all). If not provided, a default behavior is applied.

Public Functions

FilesystemOperation(sh::filesystem::Operation *operation)

Constructed only by the infrastructure and made available otherwise.

QList<std::shared_ptr<const sh::filesystem::Eurl>> itemlist(std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type = sh::filesystem::FilesystemNodeType::NONE)

Gets a list of shallot.sh::filesystem::FilesystemNode nodes in a directory (optionally filter by given types).

sh::filesystem::FilesystemNodeType getType(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Gets the shallot.sh::filesystem::FilesystemNodeType node type for an entry.

qint64 getFileSize(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Gets the file size for an entry.

QString getLinkTarget(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Gets the link target for an entry (if it is a link).

bool canGetFileContent(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Can we get the file content for an entry?

std::shared_ptr<QIODevice> getFileContent(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Gets the file content for an entry as QIODevice.

bool canCreateDirectory(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Can we create a given directory?

void createDirectory(std::shared_ptr<const sh::filesystem::Eurl> eurl, std::shared_ptr<sh::filesystem::FilesystemOperationProgressMonitor> progressmon = 0)

Creates a directory.

Parameters
  • progressmon: An optional progress monitor.

bool canCreateLink(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Can we create a given link?

void createLink(std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target, std::shared_ptr<sh::filesystem::FilesystemOperationProgressMonitor> progressmon = 0)

Creates a link.

Parameters
  • progressmon: An optional progress monitor.

bool canCreateFile(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Can we create a given file?

void createFile(std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, std::shared_ptr<sh::filesystem::FilesystemOperationProgressMonitor> progressmon = 0)

Creates a file.

Parameters
  • progressmon: An optional progress monitor.

bool canDeleteItem(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Can we delete a given entry?

void deleteItem(std::shared_ptr<const sh::filesystem::Eurl> eurl, std::shared_ptr<sh::filesystem::FilesystemOperationProgressMonitor> progressmon = 0)

Delete an entry.

Parameters
  • progressmon: An optional progress monitor.

void deleteDirectoryIfEmpty(std::shared_ptr<const sh::filesystem::Eurl> eurl, std::shared_ptr<sh::filesystem::FilesystemOperationProgressMonitor> progressmon = 0)

Delete a directory entry if empty.

Parameters
  • progressmon: An optional progress monitor.

bool canMoveItem(std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const sh::filesystem::Eurl> dest = 0)

Checks if it is allowed to move a certain item.

If the destination is known as well, it might help to pass it as well.

This does not guarantee success in the transfer, but is just a cheap early check.

void moveItems(QList<std::shared_ptr<const sh::filesystem::Eurl>> src, std::shared_ptr<const sh::filesystem::Eurl> dest, std::shared_ptr<sh::filesystem::FilesystemOperationProgressMonitor> progressmon = 0)

Moves entries.

Parameters
  • dest: The requested new common parent directory.

  • progressmon: An optional progress monitor.

void moveItem(std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const sh::filesystem::Eurl> dest, std::shared_ptr<sh::filesystem::FilesystemOperationProgressMonitor> progressmon = 0)

Moves an entry.

Parameters
  • dest: The new location (not the new parent).

  • progressmon: An optional progress monitor.

bool canCopyItem(std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const Eurl> dest = 0)

Checks if it is allowed to copy a certain item.

If the destination is known as well, it might help to pass it as well.

This does not guarantee success in the transfer, but is just a cheap early check.

void copyItems(QList<std::shared_ptr<const sh::filesystem::Eurl>> src, std::shared_ptr<const sh::filesystem::Eurl> dest, std::shared_ptr<sh::filesystem::FilesystemOperationProgressMonitor> progressmon = 0)

Copies entries.

Parameters
  • dest: The requested new common parent directory.

  • progressmon: An optional progress monitor.

void copyItem(std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const sh::filesystem::Eurl> dest, std::shared_ptr<sh::filesystem::FilesystemOperationProgressMonitor> progressmon = 0)

Copies an entry.

Parameters
  • dest: The new location (not the new parent).

  • progressmon: An optional progress monitor.

QList<std::shared_ptr<FilesystemNode>> resolveNodeLink(std::shared_ptr<FilesystemNode> node, bool recursive = true, bool excludeOwn = false)

Resolve a link as node with or without recursion.

std::shared_ptr<const sh::filesystem::Eurl> resolveEurlLink(std::shared_ptr<const sh::filesystem::Eurl> eurl, bool recursive = true, bool excludeOwn = false, int tries = 100)

Resolve a link as sh::filesystem::Eurl with or without recursion.

QList<QString> listExtendedAttributes(std::shared_ptr<const sh::filesystem::Eurl> eurl)
quint64 getExtendedAttributeSize(std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)
QByteArray getExtendedAttribute(std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)
void setExtendedAttribute(std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QByteArray value)
void removeExtendedAttribute(std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Public Static Functions

void addTransferrableDetailColumn(int index, std::shared_ptr<sh::filesystem::DetailColumn> detailColumn)

Registers a detail column for transferring it when file transfer take place.

Parameters
  • index: An integer which controls the order of transferring.

QList<std::shared_ptr<sh::filesystem::DetailColumn>> transferrableDetailColumns()

A list of all detail columns which are registered becoming transferred in file transfers.

Private Functions

std::shared_ptr<sh::filesystem::FilesystemHandler> _handler(std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<sh::filesystem::FilesystemOperationProgressMonitor> _monitor(std::shared_ptr<sh::filesystem::FilesystemOperationProgressMonitor> m)
std::shared_ptr<const sh::filesystem::Eurl> _resolveIfNeeded(std::shared_ptr<sh::filesystem::FilesystemHandler> handler, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Private Members

Operation *_operation

Private Static Attributes

QMap<int, std::shared_ptr<sh::filesystem::DetailColumn>> _detailColumnsMap
QList<std::shared_ptr<sh::filesystem::DetailColumn>> _detailColumns
QMutex _detailColumnsMutex

Friends

friend class FilesystemOperationTransfers
class MyHandlerTransfer : public sh::filesystem::FilesystemHandler::HandlerTransfer

Public Functions

MyHandlerTransfer(sh::filesystem::FilesystemOperationProgressMonitor *progressmon = 0)
~MyHandlerTransfer()
void respectCancel()
void incrementTransferredBytes(qint64 donebytes)

Private Members

sh::filesystem::FilesystemOperationProgressMonitor *_progressmon
class FilesystemOperationProgressMonitor : public std::enable_shared_from_this<FilesystemOperationProgressMonitor>
#include <filesystemoperationtransfers.h>

Implement this class and use an instance of it as parameter in some methods of sh::filesystem::FilesystemOperation for some additional functionality.

This includes monitoring the progress, specifying a resolution when conflicts in the filesystem would occur and more.

It also makes sense to directly instantiate this class in some cases.

Subclassed by sh::actions::common::ActionAbstractTransferTree::MyFilesystemOperationProgressMonitor, sh::scripting::api::ApiFilesystemOperationProgressMonitor

Public Functions

FilesystemOperationProgressMonitor(sh::actions::ActionExecutionInfo *actionExecution = 0)

Is intended to be directly constructed from everywhere.

Parameters

bool hasItemInfo()

Checks if this progress monitor provides information about how many items of a certain total number are transferred so far.

quint64 doneItems()

Checks how many items are transferred so far.

quint64 allItems()

Checks how many items are to be transferred in total (as predicted in the current moment).

bool hasBytesInfo()

Checks if this progress monitor provides information about how many byte of a certain total number are transferred so far.

quint64 doneBytes()

Checks how many bytes are transferred so far.

quint64 allBytes()

Checks how many bytes are to be transferred in total (as predicted in the current moment).

QString getItemInfoFrom()

Returns the current source of transfer (as textual information).

QString getItemInfoTo()

Returns the current destination of transfer (as textual information).

QString estimation()

Returns the current performance and time estimation (as textual information).

~FilesystemOperationProgressMonitor()

Private Functions

void setProgress(quint64 doneitems, quint64 allitems, quint64 donebytes, quint64 allbytes)

Used by FilesystemOperationTransfers for setting status changes.

void incProgress(quint64 doneitems, quint64 allitems, quint64 donebytes, quint64 allbytes)

Used by FilesystemOperationTransfers for setting status changes.

void setItemInfo(QString from, QString to)

Used by FilesystemOperationTransfers for setting status changes.

void setEstimation(QString estimation)

Used by FilesystemOperationTransfers for setting status changes.

void _enablestatistics()
void _computestatistics()
void _triggerchanged()
void _stoptriggerchanged()

Private Members

QDateTime _laststatistictime
quint64 _laststatisticdonebytes = 0
quint64 _laststatisticdoneitems = 0
double _statisticbytespeed = 0.0
double _statisticitemspeed = 0.0
int _statisticcountdown = 4
QMutex _mutex
QMutex _triggermutex
quint64 _allitems = 0
quint64 _doneitems = 0
quint64 _allbytes = 0
quint64 _donebytes = 0
bool _triggerchanged_changedrunning = false
bool _triggerchanged_changedrunagain = false
bool _triggerchanged_stopped = false
QString _itemfrom
QString _itemto
QString _estimation
QList<std::shared_ptr<const sh::filesystem::Eurl>> changes
bool _begancomputestatistics = false

Friends

friend class FilesystemOperationTransfers
friend class FilesystemOperation
class FilesystemOperationTransfers
#include <filesystemoperationtransfers.h>

Used by FilesystemOperation for managing the execution of transfer operations.

This class is only used directly by FilesystemOperation (but some inner class might be interesting).

Public Functions

FilesystemOperationTransfers(FilesystemOperation *filesystem, std::shared_ptr<FilesystemOperationProgressMonitor> progressmon)

Constructed only by the infrastructure and made available otherwise.

void executestepqueue()

Executes the queue.

The execution model is as follows: The complete queue of OperationStepClass steps becomes expanded, filesystem conflicts gets resolved and then all steps become executed.

In detail:

At first there is an interleaved process of expanding all steps (see OperationStepClass::expand) and checking/resolving filesystem conflicts in the fresh tree (see doreview). It checks all steps in the queue for conflicts (e.g. destination already exists). It expands each step which has no conflicts (by enqueueing it to the stepqueue). After those checks, it asks FilesystemOperationProgressMonitor::resolveConflicts for a resolution for all outstanding conflicts. With all the steps, which were (or are) in conflict, the entire process becomes repeated. This ends when all steps are expanded and no open conflicts exist anymore.

When this process is done, the execution phase begins. It iterates the queue. It takes the (in FIFO manner) first element (if one is there, otherwise stops). For that step, it makes a late-time conflict check at first. If a conflict appears, it becomes temporarily unexpanded. A resolution loop as above will run for this element, eventually leading to re-expansion. After the check, when no conflicts are open, it executes the step.

void addMoveItem(std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const sh::filesystem::Eurl> dest)

adds one move transfer into the queue.

void addCopyItem(std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const sh::filesystem::Eurl> dest)

adds one copy transfer into the queue.

~FilesystemOperationTransfers()

Private Functions

void _compile_moveItem(std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const sh::filesystem::Eurl> dest, QList<OperationStepClass*> *result, QList<OperationStepClass*> withExpansion)

Adds a move transfer step into given list.

void _compile_copyItem(std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const sh::filesystem::Eurl> dest, QList<OperationStepClass*> *result, QList<OperationStepClass*> withExpansion)

Adds a copy transfer step into given list.

void computeProgress()

Computes the current progress (how many items/bytes are transferred from which total?) and notifies the progress monitor.

bool doreview(QList<OperationStepClass*> reviewsteps)

Makes checks if the given queue has conflicts and for asks resolveConflicts how to handle them.

For each non-conflicting step, it triggers its expansion, thereby modifying the stepqueue.

It returns when no open conflicts exist.

Return

If there were any conflicts.

Private Members

QList<OperationStepClass*> stepqueue

The queue of steps for execution.

OperationStepClass *currentstep = 0

The step which is currently in execution (or 0).

QList<OperationStepClass*> donesteps

Steps which were already executed.

FilesystemOperation *filesystem
std::shared_ptr<FilesystemOperationProgressMonitor> progressmon
class OperationStep
#include <filesystemoperationtransfers.h>

One step of execution in a transfer operation by FilesystemOperation.

It is typically about a certain source and destination in the filesystem. It also can stay in conflict (due to checks from FilesystemOperationTransfers::doreview) and provides methods for resolving them (in FilesystemOperationTransfers::FilesystemOperationProgressMonitor::resolveConflicts).

Different subclasses implement distinct kinds of operations (e.g. copying or deleting).

Subclassed by sh::filesystem::FilesystemOperationTransfers::OperationStepClass

Public Types

enum ConflictResolution

Enumeration of ways how to resolve a filesystem conflict.

Values:

enumerator Skip

Skip this element.

enumerator OverwriteDestination

Overwrite the destination.

enumerator RenameDestinationBefore

Rename the file at the destination before transferring.

enumerator UseDifferentDestinationName

Transfer to another destination filename.

enumerator MergeDirectories

Merge source into destination directory (recursively).

enumerator Unresolved

No strategy.

enumerator Indirect

Indirectly solved. Only set by the engine.

Public Functions

OperationStep(FilesystemOperationTransfers *transfers, std::shared_ptr<const sh::filesystem::Eurl> source, std::shared_ptr<const sh::filesystem::Eurl> destination)

Constructed only by the infrastructure and made available otherwise.

QString conflictDescription()

The description of the conflict (if any) as text.

ConflictResolution conflictResolution()

The currently chosen conflict resolution.

QString conflictResolution_renameDestinationBeforeTo()

Returns new destination name (if current conflict resolution is ConflictResolution::RenameDestinationBefore).

QString conflictResolution_differentDestinationNameTo()

Returns new destination name (if current conflict resolution is ConflictResolution::UseDifferentDestinationName).

std::shared_ptr<const sh::filesystem::Eurl> source()

Returns the source location to be transferred (if specified).

std::shared_ptr<const sh::filesystem::Eurl> originalDestination()

Returns the destination location (if specified).

This is the complete target path, never the parent directory of the new element.

This is the original destination location. See also effectiveDestination.

std::shared_ptr<const sh::filesystem::Eurl> effectiveDestination()

Returns the real destination location with conflict resolution applied.

int sourcetype()

Returns the node type of the source.

Should be overwritten in subclasses whenever it can determine the source type faster than the infrastructure.

void setConflictResolve_Skip()

Set conflict resolution to ConflictResolution::Skip.

void setConflictResolve_OverwriteDestination()

Set conflict resolution to ConflictResolution::OverwriteDestination.

void setConflictResolve_RenameDestinationBefore(QString newname)

Set conflict resolution to ConflictResolution::RenameDestinationBefore.

void setConflictResolve_UseDifferentDestinationName(QString newname)

Set conflict resolution to ConflictResolution::UseDifferentDestinationName.

void setConflictResolve_MergeDirectories()

Set conflict resolution to ConflictResolution::MergeDirectories.

See also setConflictResolve_MergeDirectories_isAllowed.

bool setConflictResolve_MergeDirectories_checkAllowed()

Checks if conflict resolution ConflictResolution::MergeDirectories is allowed.

~OperationStep()

Friends

friend class FilesystemOperationTransfers
class OperationStep_ApplyDirectoryDetails : public sh::filesystem::FilesystemOperationTransfers::OperationStepClass

Public Types

enum ConflictResolution

Enumeration of ways how to resolve a filesystem conflict.

Values:

enumerator Skip

Skip this element.

enumerator OverwriteDestination

Overwrite the destination.

enumerator RenameDestinationBefore

Rename the file at the destination before transferring.

enumerator UseDifferentDestinationName

Transfer to another destination filename.

enumerator MergeDirectories

Merge source into destination directory (recursively).

enumerator Unresolved

No strategy.

enumerator Indirect

Indirectly solved. Only set by the engine.

Public Functions

OperationStep_ApplyDirectoryDetails(FilesystemOperationTransfers *transfers, std::shared_ptr<const sh::filesystem::Eurl> item, QList<QPair<sh::filesystem::DetailColumn*, QVariant>> values, QList<OperationStepClass*> withExpansion)
void execute(Operation *op)

Implement this and handle the execution part of this step here.

bool checkconflicts(Operation *op)

Implement this for customizing the conflict checking.

QList<OperationStepClass*> expand()

Implement this and handle the expansion part of this step here.

bool hasOwnProgressIncreaseHandling()

If it takes care on its own to signal increases in the transfer progress.

void _unexpand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

void _expand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

QList<QPair<sh::filesystem::DetailColumn*, QVariant>> getFileDetails(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> source)
void applyFileDetails(sh::filesystem::Operation *op, QList<QPair<sh::filesystem::DetailColumn*, QVariant>> values, std::shared_ptr<const sh::filesystem::Eurl> destination)
QString conflictDescription()

The description of the conflict (if any) as text.

ConflictResolution conflictResolution()

The currently chosen conflict resolution.

QString conflictResolution_renameDestinationBeforeTo()

Returns new destination name (if current conflict resolution is ConflictResolution::RenameDestinationBefore).

QString conflictResolution_differentDestinationNameTo()

Returns new destination name (if current conflict resolution is ConflictResolution::UseDifferentDestinationName).

std::shared_ptr<const sh::filesystem::Eurl> source()

Returns the source location to be transferred (if specified).

std::shared_ptr<const sh::filesystem::Eurl> originalDestination()

Returns the destination location (if specified).

This is the complete target path, never the parent directory of the new element.

This is the original destination location. See also effectiveDestination.

std::shared_ptr<const sh::filesystem::Eurl> effectiveDestination()

Returns the real destination location with conflict resolution applied.

int sourcetype()

Returns the node type of the source.

Should be overwritten in subclasses whenever it can determine the source type faster than the infrastructure.

void setConflictResolve_Skip()

Set conflict resolution to ConflictResolution::Skip.

void setConflictResolve_OverwriteDestination()

Set conflict resolution to ConflictResolution::OverwriteDestination.

void setConflictResolve_RenameDestinationBefore(QString newname)

Set conflict resolution to ConflictResolution::RenameDestinationBefore.

void setConflictResolve_UseDifferentDestinationName(QString newname)

Set conflict resolution to ConflictResolution::UseDifferentDestinationName.

void setConflictResolve_MergeDirectories()

Set conflict resolution to ConflictResolution::MergeDirectories.

See also setConflictResolve_MergeDirectories_isAllowed.

bool setConflictResolve_MergeDirectories_checkAllowed()

Checks if conflict resolution ConflictResolution::MergeDirectories is allowed.

Public Members

QList<QPair<sh::filesystem::DetailColumn*, QVariant>> _detailvals
quint64 _cntItems = 0

Number of items to be transferred in this step (used for progress monitoring).

quint64 _cntBytes = 0

Number of byte to be transferred in this step (used for progress monitoring).

bool _isExpanded = false

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _expandnodes

Bookkeeping in FilesystemOperationTransfers.

OperationStepClass *_parentnode = 0

Bookkeeping in FilesystemOperationTransfers.

bool _deleteonunexpand = true

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _withExpansion
class OperationStep_CopyDirectory : public sh::filesystem::FilesystemOperationTransfers::OperationStepClass

Public Types

enum ConflictResolution

Enumeration of ways how to resolve a filesystem conflict.

Values:

enumerator Skip

Skip this element.

enumerator OverwriteDestination

Overwrite the destination.

enumerator RenameDestinationBefore

Rename the file at the destination before transferring.

enumerator UseDifferentDestinationName

Transfer to another destination filename.

enumerator MergeDirectories

Merge source into destination directory (recursively).

enumerator Unresolved

No strategy.

enumerator Indirect

Indirectly solved. Only set by the engine.

Public Functions

OperationStep_CopyDirectory(FilesystemOperationTransfers *transfers, std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const sh::filesystem::Eurl> dest, QList<OperationStepClass*> withExpansion)
void execute(Operation *op)

Implement this and handle the execution part of this step here.

QList<OperationStepClass*> expand()

Implement this and handle the expansion part of this step here.

int sourcetype()

Returns the node type of the source.

Should be overwritten in subclasses whenever it can determine the source type faster than the infrastructure.

bool checkconflicts(Operation *op)

Implement this for customizing the conflict checking.

bool hasOwnProgressIncreaseHandling()

If it takes care on its own to signal increases in the transfer progress.

void _unexpand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

void _expand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

QList<QPair<sh::filesystem::DetailColumn*, QVariant>> getFileDetails(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> source)
void applyFileDetails(sh::filesystem::Operation *op, QList<QPair<sh::filesystem::DetailColumn*, QVariant>> values, std::shared_ptr<const sh::filesystem::Eurl> destination)
QString conflictDescription()

The description of the conflict (if any) as text.

ConflictResolution conflictResolution()

The currently chosen conflict resolution.

QString conflictResolution_renameDestinationBeforeTo()

Returns new destination name (if current conflict resolution is ConflictResolution::RenameDestinationBefore).

QString conflictResolution_differentDestinationNameTo()

Returns new destination name (if current conflict resolution is ConflictResolution::UseDifferentDestinationName).

std::shared_ptr<const sh::filesystem::Eurl> source()

Returns the source location to be transferred (if specified).

std::shared_ptr<const sh::filesystem::Eurl> originalDestination()

Returns the destination location (if specified).

This is the complete target path, never the parent directory of the new element.

This is the original destination location. See also effectiveDestination.

std::shared_ptr<const sh::filesystem::Eurl> effectiveDestination()

Returns the real destination location with conflict resolution applied.

void setConflictResolve_Skip()

Set conflict resolution to ConflictResolution::Skip.

void setConflictResolve_OverwriteDestination()

Set conflict resolution to ConflictResolution::OverwriteDestination.

void setConflictResolve_RenameDestinationBefore(QString newname)

Set conflict resolution to ConflictResolution::RenameDestinationBefore.

void setConflictResolve_UseDifferentDestinationName(QString newname)

Set conflict resolution to ConflictResolution::UseDifferentDestinationName.

void setConflictResolve_MergeDirectories()

Set conflict resolution to ConflictResolution::MergeDirectories.

See also setConflictResolve_MergeDirectories_isAllowed.

bool setConflictResolve_MergeDirectories_checkAllowed()

Checks if conflict resolution ConflictResolution::MergeDirectories is allowed.

Public Members

quint64 _cntItems = 0

Number of items to be transferred in this step (used for progress monitoring).

quint64 _cntBytes = 0

Number of byte to be transferred in this step (used for progress monitoring).

bool _isExpanded = false

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _expandnodes

Bookkeeping in FilesystemOperationTransfers.

OperationStepClass *_parentnode = 0

Bookkeeping in FilesystemOperationTransfers.

bool _deleteonunexpand = true

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _withExpansion
class OperationStep_CopyFile : public sh::filesystem::FilesystemOperationTransfers::OperationStepClass

Public Types

enum ConflictResolution

Enumeration of ways how to resolve a filesystem conflict.

Values:

enumerator Skip

Skip this element.

enumerator OverwriteDestination

Overwrite the destination.

enumerator RenameDestinationBefore

Rename the file at the destination before transferring.

enumerator UseDifferentDestinationName

Transfer to another destination filename.

enumerator MergeDirectories

Merge source into destination directory (recursively).

enumerator Unresolved

No strategy.

enumerator Indirect

Indirectly solved. Only set by the engine.

Public Functions

OperationStep_CopyFile(FilesystemOperationTransfers *transfers, std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const sh::filesystem::Eurl> dest, QList<OperationStepClass*> withExpansion)
void execute(Operation *op)

Implement this and handle the execution part of this step here.

int sourcetype()

Returns the node type of the source.

Should be overwritten in subclasses whenever it can determine the source type faster than the infrastructure.

bool hasOwnProgressIncreaseHandling()

If it takes care on its own to signal increases in the transfer progress.

QList<OperationStepClass*> expand()

Implement this and handle the expansion part of this step here.

bool checkconflicts(Operation *op)

Implement this for customizing the conflict checking.

void _unexpand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

void _expand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

QList<QPair<sh::filesystem::DetailColumn*, QVariant>> getFileDetails(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> source)
void applyFileDetails(sh::filesystem::Operation *op, QList<QPair<sh::filesystem::DetailColumn*, QVariant>> values, std::shared_ptr<const sh::filesystem::Eurl> destination)
QString conflictDescription()

The description of the conflict (if any) as text.

ConflictResolution conflictResolution()

The currently chosen conflict resolution.

QString conflictResolution_renameDestinationBeforeTo()

Returns new destination name (if current conflict resolution is ConflictResolution::RenameDestinationBefore).

QString conflictResolution_differentDestinationNameTo()

Returns new destination name (if current conflict resolution is ConflictResolution::UseDifferentDestinationName).

std::shared_ptr<const sh::filesystem::Eurl> source()

Returns the source location to be transferred (if specified).

std::shared_ptr<const sh::filesystem::Eurl> originalDestination()

Returns the destination location (if specified).

This is the complete target path, never the parent directory of the new element.

This is the original destination location. See also effectiveDestination.

std::shared_ptr<const sh::filesystem::Eurl> effectiveDestination()

Returns the real destination location with conflict resolution applied.

void setConflictResolve_Skip()

Set conflict resolution to ConflictResolution::Skip.

void setConflictResolve_OverwriteDestination()

Set conflict resolution to ConflictResolution::OverwriteDestination.

void setConflictResolve_RenameDestinationBefore(QString newname)

Set conflict resolution to ConflictResolution::RenameDestinationBefore.

void setConflictResolve_UseDifferentDestinationName(QString newname)

Set conflict resolution to ConflictResolution::UseDifferentDestinationName.

void setConflictResolve_MergeDirectories()

Set conflict resolution to ConflictResolution::MergeDirectories.

See also setConflictResolve_MergeDirectories_isAllowed.

bool setConflictResolve_MergeDirectories_checkAllowed()

Checks if conflict resolution ConflictResolution::MergeDirectories is allowed.

Public Members

quint64 _cntItems = 0

Number of items to be transferred in this step (used for progress monitoring).

quint64 _cntBytes = 0

Number of byte to be transferred in this step (used for progress monitoring).

bool _isExpanded = false

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _expandnodes

Bookkeeping in FilesystemOperationTransfers.

OperationStepClass *_parentnode = 0

Bookkeeping in FilesystemOperationTransfers.

bool _deleteonunexpand = true

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _withExpansion
class OperationStep_CopyLink : public sh::filesystem::FilesystemOperationTransfers::OperationStepClass

Public Types

enum ConflictResolution

Enumeration of ways how to resolve a filesystem conflict.

Values:

enumerator Skip

Skip this element.

enumerator OverwriteDestination

Overwrite the destination.

enumerator RenameDestinationBefore

Rename the file at the destination before transferring.

enumerator UseDifferentDestinationName

Transfer to another destination filename.

enumerator MergeDirectories

Merge source into destination directory (recursively).

enumerator Unresolved

No strategy.

enumerator Indirect

Indirectly solved. Only set by the engine.

Public Functions

OperationStep_CopyLink(FilesystemOperationTransfers *transfers, std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const sh::filesystem::Eurl> dest, QList<OperationStepClass*> withExpansion)
void execute(Operation *op)

Implement this and handle the execution part of this step here.

int sourcetype()

Returns the node type of the source.

Should be overwritten in subclasses whenever it can determine the source type faster than the infrastructure.

QList<OperationStepClass*> expand()

Implement this and handle the expansion part of this step here.

bool checkconflicts(Operation *op)

Implement this for customizing the conflict checking.

bool hasOwnProgressIncreaseHandling()

If it takes care on its own to signal increases in the transfer progress.

void _unexpand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

void _expand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

QList<QPair<sh::filesystem::DetailColumn*, QVariant>> getFileDetails(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> source)
void applyFileDetails(sh::filesystem::Operation *op, QList<QPair<sh::filesystem::DetailColumn*, QVariant>> values, std::shared_ptr<const sh::filesystem::Eurl> destination)
QString conflictDescription()

The description of the conflict (if any) as text.

ConflictResolution conflictResolution()

The currently chosen conflict resolution.

QString conflictResolution_renameDestinationBeforeTo()

Returns new destination name (if current conflict resolution is ConflictResolution::RenameDestinationBefore).

QString conflictResolution_differentDestinationNameTo()

Returns new destination name (if current conflict resolution is ConflictResolution::UseDifferentDestinationName).

std::shared_ptr<const sh::filesystem::Eurl> source()

Returns the source location to be transferred (if specified).

std::shared_ptr<const sh::filesystem::Eurl> originalDestination()

Returns the destination location (if specified).

This is the complete target path, never the parent directory of the new element.

This is the original destination location. See also effectiveDestination.

std::shared_ptr<const sh::filesystem::Eurl> effectiveDestination()

Returns the real destination location with conflict resolution applied.

void setConflictResolve_Skip()

Set conflict resolution to ConflictResolution::Skip.

void setConflictResolve_OverwriteDestination()

Set conflict resolution to ConflictResolution::OverwriteDestination.

void setConflictResolve_RenameDestinationBefore(QString newname)

Set conflict resolution to ConflictResolution::RenameDestinationBefore.

void setConflictResolve_UseDifferentDestinationName(QString newname)

Set conflict resolution to ConflictResolution::UseDifferentDestinationName.

void setConflictResolve_MergeDirectories()

Set conflict resolution to ConflictResolution::MergeDirectories.

See also setConflictResolve_MergeDirectories_isAllowed.

bool setConflictResolve_MergeDirectories_checkAllowed()

Checks if conflict resolution ConflictResolution::MergeDirectories is allowed.

Public Members

quint64 _cntItems = 0

Number of items to be transferred in this step (used for progress monitoring).

quint64 _cntBytes = 0

Number of byte to be transferred in this step (used for progress monitoring).

bool _isExpanded = false

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _expandnodes

Bookkeeping in FilesystemOperationTransfers.

OperationStepClass *_parentnode = 0

Bookkeeping in FilesystemOperationTransfers.

bool _deleteonunexpand = true

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _withExpansion
class OperationStep_DeleteItem : public sh::filesystem::FilesystemOperationTransfers::OperationStepClass

Public Types

enum ConflictResolution

Enumeration of ways how to resolve a filesystem conflict.

Values:

enumerator Skip

Skip this element.

enumerator OverwriteDestination

Overwrite the destination.

enumerator RenameDestinationBefore

Rename the file at the destination before transferring.

enumerator UseDifferentDestinationName

Transfer to another destination filename.

enumerator MergeDirectories

Merge source into destination directory (recursively).

enumerator Unresolved

No strategy.

enumerator Indirect

Indirectly solved. Only set by the engine.

Public Functions

OperationStep_DeleteItem(FilesystemOperationTransfers *transfers, std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const sh::filesystem::Eurl> dest, QList<OperationStepClass*> withExpansion)
void execute(Operation *op)

Implement this and handle the execution part of this step here.

bool checkconflicts(Operation *op)

Implement this for customizing the conflict checking.

int sourcetype()

Returns the node type of the source.

Should be overwritten in subclasses whenever it can determine the source type faster than the infrastructure.

QList<OperationStepClass*> expand()

Implement this and handle the expansion part of this step here.

bool hasOwnProgressIncreaseHandling()

If it takes care on its own to signal increases in the transfer progress.

void _unexpand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

void _expand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

QList<QPair<sh::filesystem::DetailColumn*, QVariant>> getFileDetails(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> source)
void applyFileDetails(sh::filesystem::Operation *op, QList<QPair<sh::filesystem::DetailColumn*, QVariant>> values, std::shared_ptr<const sh::filesystem::Eurl> destination)
QString conflictDescription()

The description of the conflict (if any) as text.

ConflictResolution conflictResolution()

The currently chosen conflict resolution.

QString conflictResolution_renameDestinationBeforeTo()

Returns new destination name (if current conflict resolution is ConflictResolution::RenameDestinationBefore).

QString conflictResolution_differentDestinationNameTo()

Returns new destination name (if current conflict resolution is ConflictResolution::UseDifferentDestinationName).

std::shared_ptr<const sh::filesystem::Eurl> source()

Returns the source location to be transferred (if specified).

std::shared_ptr<const sh::filesystem::Eurl> originalDestination()

Returns the destination location (if specified).

This is the complete target path, never the parent directory of the new element.

This is the original destination location. See also effectiveDestination.

std::shared_ptr<const sh::filesystem::Eurl> effectiveDestination()

Returns the real destination location with conflict resolution applied.

void setConflictResolve_Skip()

Set conflict resolution to ConflictResolution::Skip.

void setConflictResolve_OverwriteDestination()

Set conflict resolution to ConflictResolution::OverwriteDestination.

void setConflictResolve_RenameDestinationBefore(QString newname)

Set conflict resolution to ConflictResolution::RenameDestinationBefore.

void setConflictResolve_UseDifferentDestinationName(QString newname)

Set conflict resolution to ConflictResolution::UseDifferentDestinationName.

void setConflictResolve_MergeDirectories()

Set conflict resolution to ConflictResolution::MergeDirectories.

See also setConflictResolve_MergeDirectories_isAllowed.

bool setConflictResolve_MergeDirectories_checkAllowed()

Checks if conflict resolution ConflictResolution::MergeDirectories is allowed.

Public Members

quint64 _cntItems = 0

Number of items to be transferred in this step (used for progress monitoring).

quint64 _cntBytes = 0

Number of byte to be transferred in this step (used for progress monitoring).

bool _isExpanded = false

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _expandnodes

Bookkeeping in FilesystemOperationTransfers.

OperationStepClass *_parentnode = 0

Bookkeeping in FilesystemOperationTransfers.

bool _deleteonunexpand = true

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _withExpansion
class OperationStep_RenameItem : public sh::filesystem::FilesystemOperationTransfers::OperationStepClass

Public Types

enum ConflictResolution

Enumeration of ways how to resolve a filesystem conflict.

Values:

enumerator Skip

Skip this element.

enumerator OverwriteDestination

Overwrite the destination.

enumerator RenameDestinationBefore

Rename the file at the destination before transferring.

enumerator UseDifferentDestinationName

Transfer to another destination filename.

enumerator MergeDirectories

Merge source into destination directory (recursively).

enumerator Unresolved

No strategy.

enumerator Indirect

Indirectly solved. Only set by the engine.

Public Functions

OperationStep_RenameItem(FilesystemOperationTransfers *transfers, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath, QList<OperationStepClass*> withExpansion)
QList<OperationStepClass*> expand()

Implement this and handle the expansion part of this step here.

void execute(Operation *op)

Implement this and handle the execution part of this step here.

bool checkconflicts(Operation *op)

Implement this for customizing the conflict checking.

bool hasOwnProgressIncreaseHandling()

If it takes care on its own to signal increases in the transfer progress.

void _unexpand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

void _expand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

QList<QPair<sh::filesystem::DetailColumn*, QVariant>> getFileDetails(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> source)
void applyFileDetails(sh::filesystem::Operation *op, QList<QPair<sh::filesystem::DetailColumn*, QVariant>> values, std::shared_ptr<const sh::filesystem::Eurl> destination)
QString conflictDescription()

The description of the conflict (if any) as text.

ConflictResolution conflictResolution()

The currently chosen conflict resolution.

QString conflictResolution_renameDestinationBeforeTo()

Returns new destination name (if current conflict resolution is ConflictResolution::RenameDestinationBefore).

QString conflictResolution_differentDestinationNameTo()

Returns new destination name (if current conflict resolution is ConflictResolution::UseDifferentDestinationName).

std::shared_ptr<const sh::filesystem::Eurl> source()

Returns the source location to be transferred (if specified).

std::shared_ptr<const sh::filesystem::Eurl> originalDestination()

Returns the destination location (if specified).

This is the complete target path, never the parent directory of the new element.

This is the original destination location. See also effectiveDestination.

std::shared_ptr<const sh::filesystem::Eurl> effectiveDestination()

Returns the real destination location with conflict resolution applied.

int sourcetype()

Returns the node type of the source.

Should be overwritten in subclasses whenever it can determine the source type faster than the infrastructure.

void setConflictResolve_Skip()

Set conflict resolution to ConflictResolution::Skip.

void setConflictResolve_OverwriteDestination()

Set conflict resolution to ConflictResolution::OverwriteDestination.

void setConflictResolve_RenameDestinationBefore(QString newname)

Set conflict resolution to ConflictResolution::RenameDestinationBefore.

void setConflictResolve_UseDifferentDestinationName(QString newname)

Set conflict resolution to ConflictResolution::UseDifferentDestinationName.

void setConflictResolve_MergeDirectories()

Set conflict resolution to ConflictResolution::MergeDirectories.

See also setConflictResolve_MergeDirectories_isAllowed.

bool setConflictResolve_MergeDirectories_checkAllowed()

Checks if conflict resolution ConflictResolution::MergeDirectories is allowed.

Public Members

quint64 _cntItems = 0

Number of items to be transferred in this step (used for progress monitoring).

quint64 _cntBytes = 0

Number of byte to be transferred in this step (used for progress monitoring).

bool _isExpanded = false

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _expandnodes

Bookkeeping in FilesystemOperationTransfers.

OperationStepClass *_parentnode = 0

Bookkeeping in FilesystemOperationTransfers.

bool _deleteonunexpand = true

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _withExpansion
class OperationStepClass : public sh::filesystem::FilesystemOperationTransfers::OperationStep

A base class for all implementations.

They are used from inside FilesystemOperationTransfers::executestepqueue.

Subclassed by sh::filesystem::FilesystemOperationTransfers::OperationStep_ApplyDirectoryDetails, sh::filesystem::FilesystemOperationTransfers::OperationStep_CopyDirectory, sh::filesystem::FilesystemOperationTransfers::OperationStep_CopyFile, sh::filesystem::FilesystemOperationTransfers::OperationStep_CopyLink, sh::filesystem::FilesystemOperationTransfers::OperationStep_DeleteItem, sh::filesystem::FilesystemOperationTransfers::OperationStep_RenameItem

Public Types

enum ConflictResolution

Enumeration of ways how to resolve a filesystem conflict.

Values:

enumerator Skip

Skip this element.

enumerator OverwriteDestination

Overwrite the destination.

enumerator RenameDestinationBefore

Rename the file at the destination before transferring.

enumerator UseDifferentDestinationName

Transfer to another destination filename.

enumerator MergeDirectories

Merge source into destination directory (recursively).

enumerator Unresolved

No strategy.

enumerator Indirect

Indirectly solved. Only set by the engine.

Public Functions

OperationStepClass(FilesystemOperationTransfers *transfers, std::shared_ptr<const sh::filesystem::Eurl> source, std::shared_ptr<const Eurl> destination, QList<OperationStepClass*> withExpansion)
void execute(Operation *op) = 0

Implement this and handle the execution part of this step here.

QList<OperationStepClass*> expand()

Implement this and handle the expansion part of this step here.

bool checkconflicts(Operation *op)

Implement this for customizing the conflict checking.

bool hasOwnProgressIncreaseHandling()

If it takes care on its own to signal increases in the transfer progress.

void _unexpand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

void _expand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

~OperationStepClass()
QList<QPair<sh::filesystem::DetailColumn*, QVariant>> getFileDetails(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> source)
void applyFileDetails(sh::filesystem::Operation *op, QList<QPair<sh::filesystem::DetailColumn*, QVariant>> values, std::shared_ptr<const sh::filesystem::Eurl> destination)
QString conflictDescription()

The description of the conflict (if any) as text.

ConflictResolution conflictResolution()

The currently chosen conflict resolution.

QString conflictResolution_renameDestinationBeforeTo()

Returns new destination name (if current conflict resolution is ConflictResolution::RenameDestinationBefore).

QString conflictResolution_differentDestinationNameTo()

Returns new destination name (if current conflict resolution is ConflictResolution::UseDifferentDestinationName).

std::shared_ptr<const sh::filesystem::Eurl> source()

Returns the source location to be transferred (if specified).

std::shared_ptr<const sh::filesystem::Eurl> originalDestination()

Returns the destination location (if specified).

This is the complete target path, never the parent directory of the new element.

This is the original destination location. See also effectiveDestination.

std::shared_ptr<const sh::filesystem::Eurl> effectiveDestination()

Returns the real destination location with conflict resolution applied.

int sourcetype()

Returns the node type of the source.

Should be overwritten in subclasses whenever it can determine the source type faster than the infrastructure.

void setConflictResolve_Skip()

Set conflict resolution to ConflictResolution::Skip.

void setConflictResolve_OverwriteDestination()

Set conflict resolution to ConflictResolution::OverwriteDestination.

void setConflictResolve_RenameDestinationBefore(QString newname)

Set conflict resolution to ConflictResolution::RenameDestinationBefore.

void setConflictResolve_UseDifferentDestinationName(QString newname)

Set conflict resolution to ConflictResolution::UseDifferentDestinationName.

void setConflictResolve_MergeDirectories()

Set conflict resolution to ConflictResolution::MergeDirectories.

See also setConflictResolve_MergeDirectories_isAllowed.

bool setConflictResolve_MergeDirectories_checkAllowed()

Checks if conflict resolution ConflictResolution::MergeDirectories is allowed.

Public Members

quint64 _cntItems = 0

Number of items to be transferred in this step (used for progress monitoring).

quint64 _cntBytes = 0

Number of byte to be transferred in this step (used for progress monitoring).

bool _isExpanded = false

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _expandnodes

Bookkeeping in FilesystemOperationTransfers.

OperationStepClass *_parentnode = 0

Bookkeeping in FilesystemOperationTransfers.

bool _deleteonunexpand = true

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _withExpansion
class SingleStepMonitor : public sh::filesystem::FilesystemHandler::HandlerTransfer

Used for managing detailled progress changes about a single step.

Public Functions

SingleStepMonitor(OperationStepClass *step)
void respectCancel()
void incrementTransferredBytes(qint64 donebytes)
~SingleStepMonitor()

Private Members

OperationStepClass *step
qint64 _donebytes = 0
class LoadOnDemandPlaceholderFilesystemNode : public sh::filesystem::FilesystemNode
#include <filesystemnode.h>

A special node, which is unselectable and shows a ‘loading’ label.

It does not correspond to a file, directory or similar which actually exists. It is also never parent or a child of another node.

They are used internally by the filesystem model.

Public Functions

QString displayName()

Returns the display name (what the user interface displays).

void requestDetails(bool force)

Requests to fetch details for this node.

LoadOnDemandPlaceholderFilesystemNode(std::shared_ptr<sh::filesystem::FilesystemNode> parent)

Constructed only by the infrastructure and made available otherwise.

std::shared_ptr<const sh::filesystem::Eurl> eurl()

Returns the sh::filesystem::Eurl entry address.

sh::filesystem::FilesystemModel *model()

Convenience shortcut to the sh::filesystem::FilesystemModel.

void setDisplayName(QString displayname)

Sets the display name (what the user interface displays).

sh::filesystem::FilesystemHandler *handler()

Returns the handler which is responsible for this node. This should be the same as sh::filesystem::FilesystemHandlerRegister.findHandler(eurl.scheme).

int nodetype()

Returns the FilesystemNodeType node type.

int childnodeCount()

Returns the number of children nodes.

std::shared_ptr<sh::filesystem::FilesystemNode> childnode(int i)

Returns i-th child node.

sh::filesystem::ModelBackedFilesystemNodeList *childnodes()

Returns the list of children.

std::shared_ptr<sh::filesystem::FilesystemNode> parentnode() const

Returns the parent node.

This is 0 if the node does not exist in the model (i.e. not yet inserted or removed afterwards). In most cases, this can be interpreted as ‘file currently does not exist’.

int index()

Returns the index of this node in the parent’s list of children.

void addChild(std::shared_ptr<sh::filesystem::FilesystemNode> node)

Adds a new child. Not allowed to call more than once for a node.

void removeChild(std::shared_ptr<sh::filesystem::FilesystemNode> node)

Removes a new child. Not allowed to call more than once for a node.

bool isFetchingSubitems()

Checks if currently subitems are fetched (i.e. the ‘loading’ node is shown).

QIcon icon()

Returns the node icon.

void setIcon(QIcon icon)

Sets the node icon.

bool isHidden()

Returns if the node is hidden.

Note: It’s not difficult for the user to also show the hidden items.

void setHidden(bool v)

Sets if the node is hidden.

See also isHidden().

void addDetail(std::shared_ptr<sh::filesystem::DetailColumn> column)

Adds a detail to this node.

std::shared_ptr<sh::filesystem::DetailColumn> getDetailColumnByIndex(int index)

Returns the i-th detail column registered to this node.

int getDetailColumnsCount() const

Returns the number of detail columns registered to this node.

bool isRootNode() const

Checks if this is the root node of the model.

bool isConfigured() const

Checks if this node was already configured by a handler.

bool isAlive() const

Checks if this node currently exists in the model.

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> linkDestinationNodes() const

Returns the list of link source nodes. If this node is a link, the link destination nodes may influence the behavior and appearance of this node.

This information does not come from inside but must be set from outside the model implementation.

void setLinkDestinationNodes(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> linkdestinations)

Sets the list of link destination nodes. If this node is a link, the link destination nodes may influence the behavior and appearance of this node.

void requestContainedItems(sh::filesystem::FilesystemNodeType type = FilesystemNodeType::NONE)

Requests to fetch the children of this node with help of the filesystem handler.

Signals

void removed()

Is emitted when this node is not placed in the tree anymore. This does not mean the physical deletion of the instance, but just means it is not alive from now on.

void _detailsAvailable()

Is emitted when values for detail columns arrived.

void iconChanged()

Is emitted when the icon changed.

void isHiddenChanged()

Is emitted when the hidden flag changed.

Private Members

bool loading

Friends

friend class sh::filesystem::FilesystemModel
class ModelBackedFilesystemNodeList : public sh::filesystem::FilesystemNodeList
#include <filesystemnodelist.h>

This FilesystemNodeList subclass builds a part of the filesystem model.

The listed nodes are actually owned and handled by a sh::filesystem::FilesystemNode. Node additions and removals will directly influence the model.

Public Functions

ModelBackedFilesystemNodeList(sh::filesystem::FilesystemNode *node)

Constructed only internally.

void addItems(QSet<std::shared_ptr<FilesystemNode>> nodes)
void addItem(std::shared_ptr<FilesystemNode> node)
void removeItems(QSet<std::shared_ptr<FilesystemNode>> nodes)
void removeItem(std::shared_ptr<FilesystemNode> node)
void resetItems(sh::filesystem::FilesystemNodeType type, QSet<std::shared_ptr<FilesystemNode>> nodes)
std::shared_ptr<FilesystemNode> mynode()

Returns the node which owns this children list. The result may be 0 for non model-backed lists.

void clear()

Clears the entire list. This is not a high-level operation, but something only used internally (not part of the interface).

void addPermanentItem(std::shared_ptr<sh::filesystem::FilesystemNode> node)

Adds an item to this list. In a model-backed list, this triggers the internal model mounting calls. It is not allowed to call this method twice with the same node.

This list is safe against removing from later item lists. Only removePermanentItem removes it. See also addItem.

void removePermanentItem(std::shared_ptr<sh::filesystem::FilesystemNode> node)

Removes a permanent node from this list. In a model-backed list, this triggers the internal model unmounting calls. It is not allowed to call this method with a node, which is not contained in that list.

void addItems(QSet<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) = 0

Adds items to this list. In a model-backed list, this triggers the internal model mounting calls. It is not allowed to call this method twice with the same node.

void addItem(std::shared_ptr<sh::filesystem::FilesystemNode> node) = 0

Adds an item to this list. In a model-backed list, this triggers the internal model mounting calls. It is not allowed to call this method twice with the same node.

void removeItems(QSet<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) = 0

Removes nodes from this list. In a model-backed list, this triggers the internal model unmounting calls. It is not allowed to call this method with a node, which is not contained in that list.

void removeItem(std::shared_ptr<sh::filesystem::FilesystemNode> node) = 0

Removes a node from this list. In a model-backed list, this triggers the internal model unmounting calls. It is not allowed to call this method with a node, which is not contained in that list.

void resetItems(sh::filesystem::FilesystemNodeType type, QSet<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) = 0

Resets the list for a given node type to a given new list of children nodes.

bool contains(std::shared_ptr<FilesystemNode> node)

Checks if this list contains a given node.

const QList<std::shared_ptr<sh::filesystem::FilesystemNode>> *nodes()

Returns the list of nodes currently stored in this instance.

Private Functions

void addItem_helper(std::shared_ptr<sh::filesystem::FilesystemNode> node)

Private Members

QSet<sh::filesystem::FilesystemNode*> _permanentnodes
sh::filesystem::FilesystemNode *_mynode
sh::filesystem::FilesystemModel *mymodel
class Operation : public QObject
#include <operation.h>

A operation surrounds a completed series of steps in the filesystem.

For some steps to execute in the filesystem (i.e. not only the local one but the entire Eurl universe), it fetches intermediate files, caches them and writes them back to their real location afterwards.

It provides transaction-like operations for committing/dropping those intermediate files. A high-level interface for file management is avaiable in filesystem.

It is allowed to create new instances from scratch, but you should check if you implicitely have an instance available in your situation, or if sh::tools::OperationsCache is an option.

Public Functions

Operation(QObject *parent = 0)

Often constructed by the infrastructure and made available, but can also be constructed directly.

quint64 getFreeCacheSpace()

Returns the free disk space (in bytes) available for operations like fetchContainerFile() or fetchFile().

QString fetchContainerFile(std::shared_ptr<const sh::filesystem::Eurl> eurl, QString namehint)

Fetches the container file for a eurl locally and returns the local path. Use this with care and only if needed. In many cases working with streams is the better way!

QString fetchContainerFile(std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString fetchFile(std::shared_ptr<const sh::filesystem::Eurl> eurl, QString namehint)

Fetches a file locally and returns the local path. Use this with care and only if needed. In many cases working with streams is the better way!

QString fetchFile(std::shared_ptr<const sh::filesystem::Eurl> eurl)
void abort()

Aborts transaction dropping all pending changes.

void commit()

Commits transaction applying all pending changes.

void enableDetailsCache()

Enable details caching.

bool isDetailsCacheEnabled()

Is details caching enabled?

void storeDetailInCache(std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::DetailColumn *column, QVariant value)

Stores a column detail in cache.

QVariant getDetailFromCache(std::shared_ptr<const sh::filesystem::Eurl> eurl, const sh::filesystem::DetailColumn *column)

Gets a column value from cache.

QList<std::shared_ptr<const sh::filesystem::Eurl>> pendingCommits()

Returns a list of sh::filesystem::Eurl items which are marked for commit.

QString getTempDir()

Creates a fresh temporary folder and returns the path to it.

void setCustomData(std::shared_ptr<const sh::filesystem::Eurl> eurl, QString key, QVariant data)

Stores custom data.

QVariant getCustomData(std::shared_ptr<const sh::filesystem::Eurl> eurl, QString key)

Gets stored custom data.

void setMaxAllowedSizeRatioPerPart(double v)

Sets a maximum part of available disk space for usage. This is exotic functionality you typically don’t need. .

Parameters
  • v: A ratio (between 0 and 1) of the available disk space which one part maximally may cost.

sh::filesystem::FilesystemOperation *filesystem()

Gets the sh::filesystem::FilesystemOperation filesystem operation object.

~Operation()

Public Static Functions

void writeIODeviceToFile(QIODevice *content, QString filepath)

Low-level function for writing a QIODevice content to a local path.

Private Members

QHash<std::shared_ptr<const sh::filesystem::Eurl>, QString> files
QSet<std::shared_ptr<const sh::filesystem::Eurl>> fileIsTemporary
QList<QString> tempDirs
bool _detailsCacheEnabled = false
QHash<std::shared_ptr<const sh::filesystem::Eurl>, QMap<QString, QVariant>> _customData
QHash<const sh::filesystem::DetailColumn*, QHash<std::shared_ptr<const sh::filesystem::Eurl>, QVariant>> _detailsCache
sh::filesystem::FilesystemOperation *_filesystemOperation
double _maxAllowedSizeRatioPerPart
QMutex operationlock

Private Static Attributes

QMutex _tempfilemutex
QString _tempdir
class MaxAllowedSizeRatioPerPartExceededException : public sh::exceptions::IOException
#include <operation.h>

IO exception raised when the value in setMaxAllowedSizeRatioPerPart() was exceeded.

Public Functions

MaxAllowedSizeRatioPerPartExceededException()
QString message() const
QString name() const
QString classes() const
QString details() const
QString callstack() const
QString auxiliary() const
QString customValue(QString key) const
bool isRuntimeException() const
bool isProgramException() const
bool isRetryable() const
bool isResumeable() const
bool isDetailsAreInteresting() const
int autoRetryRecommendedIn() const
void setResumeable(bool v)
void setReTryable(bool v)
void setCustomValue(QString key, QString value)
bool isClass(QString classname)
sh::exceptions::ExceptionData data()

Public Static Functions

template<class Handler>
std::shared_ptr<RegisterHandler<Handler>> createRegisterHandler(Handler handler, QStack<Handler> *stack)
void executeGuarded(std::function<void()> fctint flags = 0, )

Executes some code with some standard exection handling around.

Parameters
  • fct: The code to execute guarded.

  • flags: Flags of ExecuteGuardFlag for choosing the behavior.

void executeGuarded_errorpanel(std::function<void()> fctint flags = 0, )
QString _demangle(QString l)
void exceptionDialog(sh::exceptions::Exception &e, bool *doRetry)

Public Static Attributes

const QString UNDEFINED_ERROR_OCCURRED = QObject::tr("An unspecified error occurred.")
const QString SHALLOT_MUST_CLOSE_TEXT = QObject::tr("Your Shallot process is disturbed by an error and needs to be closed now. You can try if starting Shallot again solves the issue. If you are interested in technical details, please take a look at the log.")
const QString Value_isShallotException = "_isShallotException"
namespace filesystemhandlers

Implementations of filesystem handlers.

Subclasses of sh::filesystem::FilesystemHandler (and possibly some auxiliary stuff). They implement how to access various types of filesystems.

Some special purpose handlers reside outside of this namespace.

class ActionMountGnomeIOLocation : public sh::actions::ActionActionItem
#include <gnomeiofilesystemhandler.h>

Action for mounting a GIO location.

Public Functions

ActionMountGnomeIOLocation(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)

Constructed only internally.

void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void offerMountGVolumeUuid(std::shared_ptr<sh::filesystem::FilesystemNode> node, QString gvolumeuuid)
void offerMountLocation(std::shared_ptr<sh::filesystem::FilesystemNode> node, QString location)
void unofferMount(std::shared_ptr<sh::filesystem::FilesystemNode> node)
void doInitialize()
void doShutdown()
QString mount(sh::actions::ActionExecutionInfo *info, QString gvolumeuuid, QString location, std::shared_ptr<filesystem::FilesystemNode> node)
class ActionMountNetworkGnomeIOLocation : public sh::actions::ActionActionItem
#include <gnomeionetworkfilesystemhandler.h>

Action for mounting a GIO network location.

Public Functions

ActionMountNetworkGnomeIOLocation()

Constructed only internally.

void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ActionUnmountGnomeIOLocation : public sh::actions::ActionActionItem
#include <gnomeiofilesystemhandler.h>

Action for unmounting a GIO location.

Public Functions

ActionUnmountGnomeIOLocation(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)

Constructed only internally.

void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Public Static Functions

void offerUnmountLocation(std::shared_ptr<sh::filesystem::FilesystemNode> node, QString location, bool staticmode = false)
void unofferUnmount(std::shared_ptr<sh::filesystem::FilesystemNode> node)
void doInitialize()
void doShutdown()
class ArchiveFilesystemHandler : public sh::filesystem::FilesystemHandler
#include <archivefilesystemhandler.h>

A filesystem handler for archive files of some formats.

This implementation uses process calls to some external utility tools.

Public Functions

ArchiveFilesystemHandler(sh::filesystem::FilesystemModel *model)
void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list)
sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time)
QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target)
bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer)
bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src)
void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath)
QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls)
void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list) = 0

Determine a list of subelements in a certain directory.

void configureItems(sh::filesystem::Operation *op, QList<std::shared_ptr<FilesystemNode>> nodes)

Configure newly created nodes (e.g. setting another icon or changing the display name).

sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine if a file is regular, or a dir, or a link, …

qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the size of a file.

QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the mtime of a file.

void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time) = 0

Set the mtime of a file.

QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine mime type of a file.

QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Resolve a link.

QList<QString> listExtendedAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Fetches the list of available extended attributes for an entry.

quint64 getExtendedAttributeSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the site of value for one extended attribute for an entry.

QByteArray getExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the value for one extended attribute for an entry.

void setExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QByteArray value)

Sets the value for one extended attribute for an entry.

void removeExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Removes one extended attributes for an entry.

QMap<QString, QString> getCustomAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Returns the custom attributes for an entry.

In contrast to extended attributes, the custom attributes are not directly stored in the filesystem this way, but handle implementation specific aspects (like permissions).

void setCustomAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QString value)

Sets the value for one custom attribute for an entry.

See also getCustomAttributes.

bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to get the content of a certain file.

std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Get the content of a file.

bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create subdirectories in a certain directory.

void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Create a directory.

bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create a link in a certain directory.

void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target) = 0

Create a link.

bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create files in a certain directory.

void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer) = 0

Creates a file with some content.

It may use handlertransfer for some better integration, like cancel support and progress monitoring.

bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to delete a certain file/directory/link/….

void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Delete a file/directory/link/…

void deleteDirectoryIfEmpty(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Deletes a directory only of it is empty.

bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src) = 0

Returns if it is allowed to rename a certain file, directory, link, … (see renameItem).

void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath) = 0

Renames an item to another path.

It can be a simple filename change or also changes in the deeper path segments.

QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) = 0

Returns a list of actions (see former example) for showing for certain files.

bool requiresResolvedLinks()

Returns if this handler requires to be used by the engine with resolved links.

void viewEnteredDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view entered some directory (e.g. for enabling watchers). See also viewLeftDirectory.

void viewLeftDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view left some directory. See also viewEnteredDirectory.

bool isWellKnownScheme()

Returns if the scheme for this handler is a well known one (which external programs typically would understand).

void search(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>, QList<std::shared_ptr<sh::search::SearchCriterion>>, sh::filesystem::FilesystemNodeType ftype)> addfile, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>)> visitdir, QList<std::shared_ptr<sh::search::SearchCriterion>> criteria, )

Helps searching for files.

Override this method with a behavior identical to the default, if a specialized implementation can be much faster than the default one.

void customizeUi(std::shared_ptr<sh::filesystem::FilesystemNode> node, bool *showSearchPanel)

Creates a custom gui, which becomes part of the fileview.

sh::filesystem::FilesystemModel *model()

A convenience shortcut to the sh::filesystem::FilesystemModel (a singleton).

Public Static Functions

void doInitialize()
void doShutdown()
class GnomeIODevicesFilesystemHandler : public sh::filesystemhandlers::GnomeIOFilesystemHandler, public sh::base::Singleton
#include <gnomeiodevicesfilesystemhandler.h>

A filesystem handler for the GIO filesystem ‘Devices’ subtree.

Public Functions

~GnomeIODevicesFilesystemHandler()
void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list) override
sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) override
void refresh()

Refreshes the device list.

void requestNewNode(std::shared_ptr<const sh::filesystem::Eurl> eurl, std::shared_ptr<sh::filesystem::FilesystemNode> *nnode)

Requests a new device node.

void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list) = 0

Determine a list of subelements in a certain directory.

sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine if a file is regular, or a dir, or a link, …

qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the size of a file.

QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the mtime of a file.

void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time)
void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time) = 0

Set the mtime of a file.

QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine mime type of a file.

QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Resolve a link.

bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to get the content of a certain file.

std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Get the content of a file.

bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create subdirectories in a certain directory.

void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Create a directory.

bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create a link in a certain directory.

void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target)
void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target) = 0

Create a link.

bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create files in a certain directory.

void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer)
void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer) = 0

Creates a file with some content.

It may use handlertransfer for some better integration, like cancel support and progress monitoring.

bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to delete a certain file/directory/link/….

void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Delete a file/directory/link/…

bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src)
bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src) = 0

Returns if it is allowed to rename a certain file, directory, link, … (see renameItem).

void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath)
void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath) = 0

Renames an item to another path.

It can be a simple filename change or also changes in the deeper path segments.

QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) = 0

Returns a list of actions (see former example) for showing for certain files.

bool requiresResolvedLinks()

Returns if this handler requires to be used by the engine with resolved links.

bool isWellKnownScheme()

Returns if the scheme for this handler is a well known one (which external programs typically would understand).

void configureItems(sh::filesystem::Operation *op, QList<std::shared_ptr<FilesystemNode>> nodes)

Configure newly created nodes (e.g. setting another icon or changing the display name).

QList<QString> listExtendedAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Fetches the list of available extended attributes for an entry.

quint64 getExtendedAttributeSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the site of value for one extended attribute for an entry.

QByteArray getExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the value for one extended attribute for an entry.

void setExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QByteArray value)

Sets the value for one extended attribute for an entry.

void removeExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Removes one extended attributes for an entry.

QMap<QString, QString> getCustomAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Returns the custom attributes for an entry.

In contrast to extended attributes, the custom attributes are not directly stored in the filesystem this way, but handle implementation specific aspects (like permissions).

void setCustomAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QString value)

Sets the value for one custom attribute for an entry.

See also getCustomAttributes.

void deleteDirectoryIfEmpty(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Deletes a directory only of it is empty.

void viewEnteredDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view entered some directory (e.g. for enabling watchers). See also viewLeftDirectory.

void viewLeftDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view left some directory. See also viewEnteredDirectory.

void search(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>, QList<std::shared_ptr<sh::search::SearchCriterion>>, sh::filesystem::FilesystemNodeType ftype)> addfile, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>)> visitdir, QList<std::shared_ptr<sh::search::SearchCriterion>> criteria, )

Helps searching for files.

Override this method with a behavior identical to the default, if a specialized implementation can be much faster than the default one.

void customizeUi(std::shared_ptr<sh::filesystem::FilesystemNode> node, bool *showSearchPanel)

Creates a custom gui, which becomes part of the fileview.

sh::filesystem::FilesystemModel *model()

A convenience shortcut to the sh::filesystem::FilesystemModel (a singleton).

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 Functions

QString mountDevice(QString gvolumeuuid, sh::actions::ActionExecutionInfo *info)
QString mountLocation(QString gurl, sh::actions::ActionExecutionInfo *info)
QString unmountLocation(QString gurl, sh::actions::ActionExecutionInfo *info)
QByteArray eurl2gurlb(std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString eurl2gurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<const sh::filesystem::Eurl> gurl2eurl(QString gurl)
void logIfError(void *error)
void throwIfError(void *error)

Private Functions

GnomeIODevicesFilesystemHandler()

Friends

friend class ActionMount
class GnomeIOFilesystemHandler : public sh::filesystem::FilesystemHandler
#include <gnomeiofilesystemhandler.h>

A filesystem handler for GIO filesystem parts.

This is the abstract base class.

Subclassed by sh::filesystemhandlers::GnomeIODevicesFilesystemHandler, sh::filesystemhandlers::GnomeIOGenericFilesystemHandler, sh::filesystemhandlers::GnomeIONetworkFilesystemHandler, sh::filesystemhandlers::GnomeIOSmbFilesystemHandler

Public Functions

GnomeIOFilesystemHandler()
void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list)
sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time)
QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target)
bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer)
bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src)
void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath)
QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls)
bool requiresResolvedLinks()

Returns if this handler requires to be used by the engine with resolved links.

bool isWellKnownScheme()

Returns if the scheme for this handler is a well known one (which external programs typically would understand).

void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list) = 0

Determine a list of subelements in a certain directory.

void configureItems(sh::filesystem::Operation *op, QList<std::shared_ptr<FilesystemNode>> nodes)

Configure newly created nodes (e.g. setting another icon or changing the display name).

sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine if a file is regular, or a dir, or a link, …

qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the size of a file.

QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the mtime of a file.

void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time) = 0

Set the mtime of a file.

QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine mime type of a file.

QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Resolve a link.

QList<QString> listExtendedAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Fetches the list of available extended attributes for an entry.

quint64 getExtendedAttributeSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the site of value for one extended attribute for an entry.

QByteArray getExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the value for one extended attribute for an entry.

void setExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QByteArray value)

Sets the value for one extended attribute for an entry.

void removeExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Removes one extended attributes for an entry.

QMap<QString, QString> getCustomAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Returns the custom attributes for an entry.

In contrast to extended attributes, the custom attributes are not directly stored in the filesystem this way, but handle implementation specific aspects (like permissions).

void setCustomAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QString value)

Sets the value for one custom attribute for an entry.

See also getCustomAttributes.

bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to get the content of a certain file.

std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Get the content of a file.

bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create subdirectories in a certain directory.

void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Create a directory.

bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create a link in a certain directory.

void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target) = 0

Create a link.

bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create files in a certain directory.

void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer) = 0

Creates a file with some content.

It may use handlertransfer for some better integration, like cancel support and progress monitoring.

bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to delete a certain file/directory/link/….

void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Delete a file/directory/link/…

void deleteDirectoryIfEmpty(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Deletes a directory only of it is empty.

bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src) = 0

Returns if it is allowed to rename a certain file, directory, link, … (see renameItem).

void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath) = 0

Renames an item to another path.

It can be a simple filename change or also changes in the deeper path segments.

QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) = 0

Returns a list of actions (see former example) for showing for certain files.

void viewEnteredDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view entered some directory (e.g. for enabling watchers). See also viewLeftDirectory.

void viewLeftDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view left some directory. See also viewEnteredDirectory.

void search(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>, QList<std::shared_ptr<sh::search::SearchCriterion>>, sh::filesystem::FilesystemNodeType ftype)> addfile, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>)> visitdir, QList<std::shared_ptr<sh::search::SearchCriterion>> criteria, )

Helps searching for files.

Override this method with a behavior identical to the default, if a specialized implementation can be much faster than the default one.

void customizeUi(std::shared_ptr<sh::filesystem::FilesystemNode> node, bool *showSearchPanel)

Creates a custom gui, which becomes part of the fileview.

sh::filesystem::FilesystemModel *model()

A convenience shortcut to the sh::filesystem::FilesystemModel (a singleton).

Public Static Functions

QString mountDevice(QString gvolumeuuid, sh::actions::ActionExecutionInfo *info)
QString mountLocation(QString gurl, sh::actions::ActionExecutionInfo *info)
QString unmountLocation(QString gurl, sh::actions::ActionExecutionInfo *info)
QByteArray eurl2gurlb(std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString eurl2gurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<const sh::filesystem::Eurl> gurl2eurl(QString gurl)
void logIfError(void *error)
void throwIfError(void *error)
class MountOperations
#include <gnomeiofilesystemhandler.h>

Public Static Functions

void *createMountOperation(sh::actions::ActionExecutionInfo *info, QString address, MountOperationsCallbackData **opdata)
void deleteMountOperation(MountOperationsCallbackData *opdata)

Public Static Attributes

QHash<size_t, MountOperationsCallbackData*> callbackdata
size_t callbackdataindex
QMutex callbackdatamutex
struct MountOperationsCallbackData
#include <gnomeiofilesystemhandler.h>

Public Functions

MountOperationsCallbackData(sh::actions::ActionExecutionInfo *info, size_t index, void *mountoperation, QString address)

Public Members

sh::actions::ActionExecutionInfo *info
size_t index
void *mountoperation
QString address
class GnomeIOGenericFilesystemHandler : public sh::filesystemhandlers::GnomeIOFilesystemHandler
#include <gnomeiogenericfilesystemhandler.h>

A filesystem handler for common/unspecial GIO filesystem parts.

This is a generic non-abstract implementation without special behavior.

Public Functions

GnomeIOGenericFilesystemHandler(sh::filesystem::FilesystemModel *model)
void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list)
void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list) = 0

Determine a list of subelements in a certain directory.

sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine if a file is regular, or a dir, or a link, …

qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the size of a file.

QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the mtime of a file.

void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time)
void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time) = 0

Set the mtime of a file.

QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine mime type of a file.

QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Resolve a link.

bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to get the content of a certain file.

std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Get the content of a file.

bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create subdirectories in a certain directory.

void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Create a directory.

bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create a link in a certain directory.

void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target)
void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target) = 0

Create a link.

bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create files in a certain directory.

void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer)
void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer) = 0

Creates a file with some content.

It may use handlertransfer for some better integration, like cancel support and progress monitoring.

bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to delete a certain file/directory/link/….

void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Delete a file/directory/link/…

bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src)
bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src) = 0

Returns if it is allowed to rename a certain file, directory, link, … (see renameItem).

void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath)
void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath) = 0

Renames an item to another path.

It can be a simple filename change or also changes in the deeper path segments.

QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls)
QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) = 0

Returns a list of actions (see former example) for showing for certain files.

bool requiresResolvedLinks()

Returns if this handler requires to be used by the engine with resolved links.

bool isWellKnownScheme()

Returns if the scheme for this handler is a well known one (which external programs typically would understand).

void configureItems(sh::filesystem::Operation *op, QList<std::shared_ptr<FilesystemNode>> nodes)

Configure newly created nodes (e.g. setting another icon or changing the display name).

QList<QString> listExtendedAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Fetches the list of available extended attributes for an entry.

quint64 getExtendedAttributeSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the site of value for one extended attribute for an entry.

QByteArray getExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the value for one extended attribute for an entry.

void setExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QByteArray value)

Sets the value for one extended attribute for an entry.

void removeExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Removes one extended attributes for an entry.

QMap<QString, QString> getCustomAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Returns the custom attributes for an entry.

In contrast to extended attributes, the custom attributes are not directly stored in the filesystem this way, but handle implementation specific aspects (like permissions).

void setCustomAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QString value)

Sets the value for one custom attribute for an entry.

See also getCustomAttributes.

void deleteDirectoryIfEmpty(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Deletes a directory only of it is empty.

void viewEnteredDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view entered some directory (e.g. for enabling watchers). See also viewLeftDirectory.

void viewLeftDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view left some directory. See also viewEnteredDirectory.

void search(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>, QList<std::shared_ptr<sh::search::SearchCriterion>>, sh::filesystem::FilesystemNodeType ftype)> addfile, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>)> visitdir, QList<std::shared_ptr<sh::search::SearchCriterion>> criteria, )

Helps searching for files.

Override this method with a behavior identical to the default, if a specialized implementation can be much faster than the default one.

void customizeUi(std::shared_ptr<sh::filesystem::FilesystemNode> node, bool *showSearchPanel)

Creates a custom gui, which becomes part of the fileview.

sh::filesystem::FilesystemModel *model()

A convenience shortcut to the sh::filesystem::FilesystemModel (a singleton).

Public Static Functions

QString mountDevice(QString gvolumeuuid, sh::actions::ActionExecutionInfo *info)
QString mountLocation(QString gurl, sh::actions::ActionExecutionInfo *info)
QString unmountLocation(QString gurl, sh::actions::ActionExecutionInfo *info)
QByteArray eurl2gurlb(std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString eurl2gurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<const sh::filesystem::Eurl> gurl2eurl(QString gurl)
void logIfError(void *error)
void throwIfError(void *error)
class GnomeIONetworkFilesystemHandler : public sh::filesystemhandlers::GnomeIOFilesystemHandler, public sh::base::Singleton
#include <gnomeionetworkfilesystemhandler.h>

A filesystem handler for the GIO filesystem ‘Network’ subtree.

Public Functions

QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) override
void requestNewNode(std::shared_ptr<const sh::filesystem::Eurl> eurl, std::shared_ptr<sh::filesystem::FilesystemNode> *nnode)

Requests a new network node.

void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list)
void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list) = 0

Determine a list of subelements in a certain directory.

sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine if a file is regular, or a dir, or a link, …

qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the size of a file.

QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the mtime of a file.

void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time)
void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time) = 0

Set the mtime of a file.

QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine mime type of a file.

QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Resolve a link.

bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to get the content of a certain file.

std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Get the content of a file.

bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create subdirectories in a certain directory.

void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Create a directory.

bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create a link in a certain directory.

void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target)
void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target) = 0

Create a link.

bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create files in a certain directory.

void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer)
void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer) = 0

Creates a file with some content.

It may use handlertransfer for some better integration, like cancel support and progress monitoring.

bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to delete a certain file/directory/link/….

void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Delete a file/directory/link/…

bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src)
bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src) = 0

Returns if it is allowed to rename a certain file, directory, link, … (see renameItem).

void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath)
void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath) = 0

Renames an item to another path.

It can be a simple filename change or also changes in the deeper path segments.

QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) = 0

Returns a list of actions (see former example) for showing for certain files.

bool requiresResolvedLinks()

Returns if this handler requires to be used by the engine with resolved links.

bool isWellKnownScheme()

Returns if the scheme for this handler is a well known one (which external programs typically would understand).

void configureItems(sh::filesystem::Operation *op, QList<std::shared_ptr<FilesystemNode>> nodes)

Configure newly created nodes (e.g. setting another icon or changing the display name).

QList<QString> listExtendedAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Fetches the list of available extended attributes for an entry.

quint64 getExtendedAttributeSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the site of value for one extended attribute for an entry.

QByteArray getExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the value for one extended attribute for an entry.

void setExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QByteArray value)

Sets the value for one extended attribute for an entry.

void removeExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Removes one extended attributes for an entry.

QMap<QString, QString> getCustomAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Returns the custom attributes for an entry.

In contrast to extended attributes, the custom attributes are not directly stored in the filesystem this way, but handle implementation specific aspects (like permissions).

void setCustomAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QString value)

Sets the value for one custom attribute for an entry.

See also getCustomAttributes.

void deleteDirectoryIfEmpty(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Deletes a directory only of it is empty.

void viewEnteredDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view entered some directory (e.g. for enabling watchers). See also viewLeftDirectory.

void viewLeftDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view left some directory. See also viewEnteredDirectory.

void search(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>, QList<std::shared_ptr<sh::search::SearchCriterion>>, sh::filesystem::FilesystemNodeType ftype)> addfile, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>)> visitdir, QList<std::shared_ptr<sh::search::SearchCriterion>> criteria, )

Helps searching for files.

Override this method with a behavior identical to the default, if a specialized implementation can be much faster than the default one.

void customizeUi(std::shared_ptr<sh::filesystem::FilesystemNode> node, bool *showSearchPanel)

Creates a custom gui, which becomes part of the fileview.

sh::filesystem::FilesystemModel *model()

A convenience shortcut to the sh::filesystem::FilesystemModel (a singleton).

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 Functions

QString mountDevice(QString gvolumeuuid, sh::actions::ActionExecutionInfo *info)
QString mountLocation(QString gurl, sh::actions::ActionExecutionInfo *info)
QString unmountLocation(QString gurl, sh::actions::ActionExecutionInfo *info)
QByteArray eurl2gurlb(std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString eurl2gurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<const sh::filesystem::Eurl> gurl2eurl(QString gurl)
void logIfError(void *error)
void throwIfError(void *error)

Private Functions

GnomeIONetworkFilesystemHandler()
class GnomeIOSmbFilesystemHandler : public sh::filesystemhandlers::GnomeIOFilesystemHandler, public sh::base::Singleton
#include <gnomeiosmbfilesystemhandler.h>

A filesystem handler for the GIO filesystem ‘smb’ subtrees (in ‘Network’).

Public Functions

sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list)
void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list) = 0

Determine a list of subelements in a certain directory.

sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine if a file is regular, or a dir, or a link, …

qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the size of a file.

QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the mtime of a file.

void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time)
void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time) = 0

Set the mtime of a file.

QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine mime type of a file.

QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Resolve a link.

bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to get the content of a certain file.

std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Get the content of a file.

bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create subdirectories in a certain directory.

void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Create a directory.

bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create a link in a certain directory.

void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target)
void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target) = 0

Create a link.

bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create files in a certain directory.

void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer)
void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer) = 0

Creates a file with some content.

It may use handlertransfer for some better integration, like cancel support and progress monitoring.

bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to delete a certain file/directory/link/….

void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Delete a file/directory/link/…

bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src)
bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src) = 0

Returns if it is allowed to rename a certain file, directory, link, … (see renameItem).

void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath)
void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath) = 0

Renames an item to another path.

It can be a simple filename change or also changes in the deeper path segments.

QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls)
QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) = 0

Returns a list of actions (see former example) for showing for certain files.

bool requiresResolvedLinks()

Returns if this handler requires to be used by the engine with resolved links.

bool isWellKnownScheme()

Returns if the scheme for this handler is a well known one (which external programs typically would understand).

void configureItems(sh::filesystem::Operation *op, QList<std::shared_ptr<FilesystemNode>> nodes)

Configure newly created nodes (e.g. setting another icon or changing the display name).

QList<QString> listExtendedAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Fetches the list of available extended attributes for an entry.

quint64 getExtendedAttributeSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the site of value for one extended attribute for an entry.

QByteArray getExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the value for one extended attribute for an entry.

void setExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QByteArray value)

Sets the value for one extended attribute for an entry.

void removeExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Removes one extended attributes for an entry.

QMap<QString, QString> getCustomAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Returns the custom attributes for an entry.

In contrast to extended attributes, the custom attributes are not directly stored in the filesystem this way, but handle implementation specific aspects (like permissions).

void setCustomAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QString value)

Sets the value for one custom attribute for an entry.

See also getCustomAttributes.

void deleteDirectoryIfEmpty(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Deletes a directory only of it is empty.

void viewEnteredDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view entered some directory (e.g. for enabling watchers). See also viewLeftDirectory.

void viewLeftDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view left some directory. See also viewEnteredDirectory.

void search(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>, QList<std::shared_ptr<sh::search::SearchCriterion>>, sh::filesystem::FilesystemNodeType ftype)> addfile, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>)> visitdir, QList<std::shared_ptr<sh::search::SearchCriterion>> criteria, )

Helps searching for files.

Override this method with a behavior identical to the default, if a specialized implementation can be much faster than the default one.

void customizeUi(std::shared_ptr<sh::filesystem::FilesystemNode> node, bool *showSearchPanel)

Creates a custom gui, which becomes part of the fileview.

sh::filesystem::FilesystemModel *model()

A convenience shortcut to the sh::filesystem::FilesystemModel (a singleton).

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 Functions

QString mountDevice(QString gvolumeuuid, sh::actions::ActionExecutionInfo *info)
QString mountLocation(QString gurl, sh::actions::ActionExecutionInfo *info)
QString unmountLocation(QString gurl, sh::actions::ActionExecutionInfo *info)
QByteArray eurl2gurlb(std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString eurl2gurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<const sh::filesystem::Eurl> gurl2eurl(QString gurl)
void logIfError(void *error)
void throwIfError(void *error)

Private Functions

GnomeIOSmbFilesystemHandler()
class LocalFilesystemHandler : public sh::filesystem::FilesystemHandler, public sh::base::Singleton
#include <localfilesystemhandler.h>

A filesystem handler for the local filesystem.

Subclassed by sh::filesystemhandlers::WindowsNetworkFilesystemHandler

Public Functions

void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list) override
void configureItems(sh::filesystem::Operation *op, QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) override

Configure newly created nodes (e.g. setting another icon or changing the display name).

sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime mtime) override
QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target) override
bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer) override
bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src) override
void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath) override
QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) override
QList<QString> listExtendedAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
quint64 getExtendedAttributeSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute) override
QByteArray getExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute) override
void setExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QByteArray value) override
void removeExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute) override
QMap<QString, QString> getCustomAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
void setCustomAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QString value) override
bool requiresResolvedLinks() override

Returns if this handler requires to be used by the engine with resolved links.

bool isWellKnownScheme() override

Returns if the scheme for this handler is a well known one (which external programs typically would understand).

QString eurlToLocal(std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<const sh::filesystem::Eurl> localToEurl(const QString local)
void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list) = 0

Determine a list of subelements in a certain directory.

sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine if a file is regular, or a dir, or a link, …

qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the size of a file.

QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the mtime of a file.

void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time) = 0

Set the mtime of a file.

QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine mime type of a file.

QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Resolve a link.

QList<QString> listExtendedAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Fetches the list of available extended attributes for an entry.

quint64 getExtendedAttributeSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the site of value for one extended attribute for an entry.

QByteArray getExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the value for one extended attribute for an entry.

void setExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QByteArray value)

Sets the value for one extended attribute for an entry.

void removeExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Removes one extended attributes for an entry.

QMap<QString, QString> getCustomAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Returns the custom attributes for an entry.

In contrast to extended attributes, the custom attributes are not directly stored in the filesystem this way, but handle implementation specific aspects (like permissions).

void setCustomAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QString value)

Sets the value for one custom attribute for an entry.

See also getCustomAttributes.

bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to get the content of a certain file.

std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Get the content of a file.

bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create subdirectories in a certain directory.

void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Create a directory.

bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create a link in a certain directory.

void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target) = 0

Create a link.

bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create files in a certain directory.

void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer) = 0

Creates a file with some content.

It may use handlertransfer for some better integration, like cancel support and progress monitoring.

bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to delete a certain file/directory/link/….

void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Delete a file/directory/link/…

void deleteDirectoryIfEmpty(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Deletes a directory only of it is empty.

bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src) = 0

Returns if it is allowed to rename a certain file, directory, link, … (see renameItem).

void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath) = 0

Renames an item to another path.

It can be a simple filename change or also changes in the deeper path segments.

QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) = 0

Returns a list of actions (see former example) for showing for certain files.

void viewEnteredDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view entered some directory (e.g. for enabling watchers). See also viewLeftDirectory.

void viewLeftDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view left some directory. See also viewEnteredDirectory.

void search(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>, QList<std::shared_ptr<sh::search::SearchCriterion>>, sh::filesystem::FilesystemNodeType ftype)> addfile, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>)> visitdir, QList<std::shared_ptr<sh::search::SearchCriterion>> criteria, )

Helps searching for files.

Override this method with a behavior identical to the default, if a specialized implementation can be much faster than the default one.

void customizeUi(std::shared_ptr<sh::filesystem::FilesystemNode> node, bool *showSearchPanel)

Creates a custom gui, which becomes part of the fileview.

sh::filesystem::FilesystemModel *model()

A convenience shortcut to the sh::filesystem::FilesystemModel (a singleton).

void doShutdown()

Executes singleton shutdown.

void shutdown()

Shutdown down this singleton.

bool isAlive()

Returns if this singleton is alive (true until its shutdown begins).

class SharcFilesystemHandler : public sh::filesystem::FilesystemHandler, public sh::base::Singleton
#include <sharcfilesystemhandler.h>

A filesystem handler for the sharc archives.

This is a brutally easy and inefficient archive format which exists mostly for testing.

Public Functions

void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list) override
void configureItems(sh::filesystem::Operation *op, QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) override
sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time) override
QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target) override
bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer) override
bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src) override
void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath) override
QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) override
void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list) = 0

Determine a list of subelements in a certain directory.

void configureItems(sh::filesystem::Operation *op, QList<std::shared_ptr<FilesystemNode>> nodes)

Configure newly created nodes (e.g. setting another icon or changing the display name).

sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine if a file is regular, or a dir, or a link, …

qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the size of a file.

QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the mtime of a file.

void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time) = 0

Set the mtime of a file.

QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine mime type of a file.

QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Resolve a link.

QList<QString> listExtendedAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Fetches the list of available extended attributes for an entry.

quint64 getExtendedAttributeSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the site of value for one extended attribute for an entry.

QByteArray getExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the value for one extended attribute for an entry.

void setExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QByteArray value)

Sets the value for one extended attribute for an entry.

void removeExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Removes one extended attributes for an entry.

QMap<QString, QString> getCustomAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Returns the custom attributes for an entry.

In contrast to extended attributes, the custom attributes are not directly stored in the filesystem this way, but handle implementation specific aspects (like permissions).

void setCustomAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QString value)

Sets the value for one custom attribute for an entry.

See also getCustomAttributes.

bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to get the content of a certain file.

std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Get the content of a file.

bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create subdirectories in a certain directory.

void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Create a directory.

bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create a link in a certain directory.

void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target) = 0

Create a link.

bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create files in a certain directory.

void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer) = 0

Creates a file with some content.

It may use handlertransfer for some better integration, like cancel support and progress monitoring.

bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to delete a certain file/directory/link/….

void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Delete a file/directory/link/…

void deleteDirectoryIfEmpty(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Deletes a directory only of it is empty.

bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src) = 0

Returns if it is allowed to rename a certain file, directory, link, … (see renameItem).

void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath) = 0

Renames an item to another path.

It can be a simple filename change or also changes in the deeper path segments.

QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) = 0

Returns a list of actions (see former example) for showing for certain files.

bool requiresResolvedLinks()

Returns if this handler requires to be used by the engine with resolved links.

void viewEnteredDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view entered some directory (e.g. for enabling watchers). See also viewLeftDirectory.

void viewLeftDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view left some directory. See also viewEnteredDirectory.

bool isWellKnownScheme()

Returns if the scheme for this handler is a well known one (which external programs typically would understand).

void search(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>, QList<std::shared_ptr<sh::search::SearchCriterion>>, sh::filesystem::FilesystemNodeType ftype)> addfile, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>)> visitdir, QList<std::shared_ptr<sh::search::SearchCriterion>> criteria, )

Helps searching for files.

Override this method with a behavior identical to the default, if a specialized implementation can be much faster than the default one.

void customizeUi(std::shared_ptr<sh::filesystem::FilesystemNode> node, bool *showSearchPanel)

Creates a custom gui, which becomes part of the fileview.

sh::filesystem::FilesystemModel *model()

A convenience shortcut to the sh::filesystem::FilesystemModel (a singleton).

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 Functions

std::shared_ptr<const filesystem::Eurl> localToEurl(const QString local)

Private Functions

SharcFilesystemHandler()
class WindowsNetworkFilesystemHandler : public sh::filesystemhandlers::LocalFilesystemHandler
#include <windowsnetworkfilesystemhandler.h>

Public Functions

void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list) override
void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list) = 0

Determine a list of subelements in a certain directory.

void configureItems(sh::filesystem::Operation *op, QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) override

Configure newly created nodes (e.g. setting another icon or changing the display name).

sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine if a file is regular, or a dir, or a link, …

qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the size of a file.

QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the mtime of a file.

void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime mtime) override
void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time) = 0

Set the mtime of a file.

QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine mime type of a file.

QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Resolve a link.

bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to get the content of a certain file.

std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Get the content of a file.

bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create subdirectories in a certain directory.

void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Create a directory.

bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create a link in a certain directory.

void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target) override
void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target) = 0

Create a link.

bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create files in a certain directory.

void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer) override
void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer) = 0

Creates a file with some content.

It may use handlertransfer for some better integration, like cancel support and progress monitoring.

bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to delete a certain file/directory/link/….

void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Delete a file/directory/link/…

bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src) override
bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src) = 0

Returns if it is allowed to rename a certain file, directory, link, … (see renameItem).

void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath) override
void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath) = 0

Renames an item to another path.

It can be a simple filename change or also changes in the deeper path segments.

QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) override
QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) = 0

Returns a list of actions (see former example) for showing for certain files.

QList<QString> listExtendedAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
QList<QString> listExtendedAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Fetches the list of available extended attributes for an entry.

quint64 getExtendedAttributeSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute) override
quint64 getExtendedAttributeSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the site of value for one extended attribute for an entry.

QByteArray getExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute) override
QByteArray getExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the value for one extended attribute for an entry.

void setExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QByteArray value) override
void setExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QByteArray value)

Sets the value for one extended attribute for an entry.

void removeExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute) override
void removeExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Removes one extended attributes for an entry.

QMap<QString, QString> getCustomAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
QMap<QString, QString> getCustomAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Returns the custom attributes for an entry.

In contrast to extended attributes, the custom attributes are not directly stored in the filesystem this way, but handle implementation specific aspects (like permissions).

void setCustomAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QString value) override
void setCustomAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QString value)

Sets the value for one custom attribute for an entry.

See also getCustomAttributes.

bool requiresResolvedLinks() override

Returns if this handler requires to be used by the engine with resolved links.

bool isWellKnownScheme() override

Returns if the scheme for this handler is a well known one (which external programs typically would understand).

QString eurlToLocal(std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<const sh::filesystem::Eurl> localToEurl(const QString local)
void deleteDirectoryIfEmpty(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Deletes a directory only of it is empty.

void viewEnteredDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view entered some directory (e.g. for enabling watchers). See also viewLeftDirectory.

void viewLeftDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view left some directory. See also viewEnteredDirectory.

void search(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>, QList<std::shared_ptr<sh::search::SearchCriterion>>, sh::filesystem::FilesystemNodeType ftype)> addfile, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>)> visitdir, QList<std::shared_ptr<sh::search::SearchCriterion>> criteria, )

Helps searching for files.

Override this method with a behavior identical to the default, if a specialized implementation can be much faster than the default one.

void customizeUi(std::shared_ptr<sh::filesystem::FilesystemNode> node, bool *showSearchPanel)

Creates a custom gui, which becomes part of the fileview.

sh::filesystem::FilesystemModel *model()

A convenience shortcut to the sh::filesystem::FilesystemModel (a singleton).

void doShutdown()

Executes singleton shutdown.

void shutdown()

Shutdown down this singleton.

bool isAlive()

Returns if this singleton is alive (true until its shutdown begins).

namespace paneldetails

Infrastructure for panel details.

Can be shown in the bottom part of the main window. Beyond the infrastructure, it also includes some very basic detail providers.

See sh::paneldetails::PanelDetailManager for more.

Enums

enum PanelDetailPositionIndex

Base values for position indexes of panel details.

Values:

enumerator VeryInteresting = 1000000
enumerator Interesting = 2000000
enumerator Exotic = 3000000
class CommonPanelDetails
#include <commonpaneldetails.h>

Implementations of common details provider for the details panel.

Public Static Functions

void doInitialize()
void doShutdown()
void _ViaDetailColumn(std::shared_ptr<PanelDetail> detail, std::shared_ptr<sh::filesystem::FilesystemNode> node, std::shared_ptr<sh::filesystem::DetailColumn> column, QString keyname, std::function<QString(QVariant)> valtostring)
void NumberOfSelectedItems(std::shared_ptr<PanelDetail>, QList<std::shared_ptr<sh::filesystem::FilesystemNode>>, sh::filesystem::Operation *op)
void TotalFileSize(std::shared_ptr<PanelDetail>, QList<std::shared_ptr<sh::filesystem::FilesystemNode>>, sh::filesystem::Operation *op)
void FileType(std::shared_ptr<PanelDetail> detail, std::shared_ptr<sh::filesystem::FilesystemNode> node, sh::filesystem::Operation *op)
void FileSize(std::shared_ptr<PanelDetail> detail, std::shared_ptr<sh::filesystem::FilesystemNode> node, sh::filesystem::Operation *op)
void FileModificationTime(std::shared_ptr<PanelDetail> detail, std::shared_ptr<sh::filesystem::FilesystemNode> node, sh::filesystem::Operation *op)
class PanelDetail : public QObject
#include <paneldetailmanager.h>

A detail panel entry.

Is is essentially a list of PanelDetailRow and some layout information.

Public Functions

PanelDetail(int positionIndex, int valueWidthHint)

Constructed only by the infrastructure and made available otherwise.

QList<PanelDetailRow> rows()

Returns the list of detail rows stored in this panel detail.

int positionIndex()

Returns a position index.

It controls the position of this panel detail in relation to the other ones.

int valueWidthHint()

Returns the specified width for the panel detail.

void setRows(QList<PanelDetailRow> rows)

Sets the list of detail rows.

void addRow(PanelDetailRow row)

Adds a new detail row.

void addOrReplaceRow(PanelDetailRow row)

Adds a new detail row (replacing an old one with the same key).

void _emit_linkTriggered(QString link)

Signals

void changed()

Emitted when data has changed.

void linkTriggered(QString link)

Emitted when a link is triggered by the user.

Private Members

QMutex _rowsmutex
QList<PanelDetailRow> _rows
int _positionIndex
int _valueWidthHint
class PanelDetailFactory
#include <paneldetailmanager.h>

Abstract factory for creating panel details for the selected nodes.

Subclassed by sh::paneldetails::PanelDetailFactoryForFunctionMulti, sh::paneldetails::PanelDetailFactoryForFunctionSingle

Public Functions

std::shared_ptr<PanelDetail> construct(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes, sh::filesystem::Operation *op) = 0
class PanelDetailFactoryForFunctionMulti : public sh::paneldetails::PanelDetailFactory
#include <paneldetailmanager.h>

A factory for creating panel details for more than one selected node.

Subclassed by sh::scripting::api::ApiPanelDetailFactoryMulti

Public Functions

PanelDetailFactoryForFunctionMulti(std::function<void(std::shared_ptr<PanelDetail>, QList<std::shared_ptr<sh::filesystem::FilesystemNode>>, sh::filesystem::Operation *op)> fctsetvalue, std::function<void(QList<std::shared_ptr<sh::filesystem::FilesystemNode>>, QString link)> fctlinktriggered, int position, int valueWidthHint, )

Constructed only indirectly.

std::shared_ptr<PanelDetail> construct(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes, sh::filesystem::Operation *op)
class PanelDetailFactoryForFunctionSingle : public sh::paneldetails::PanelDetailFactory
#include <paneldetailmanager.h>

A factory for creating panel details for just one selected node.

Subclassed by sh::scripting::api::ApiPanelDetailFactorySingle

Public Functions

PanelDetailFactoryForFunctionSingle(std::function<void(std::shared_ptr<PanelDetail>, std::shared_ptr<sh::filesystem::FilesystemNode>, sh::filesystem::Operation *op)> fctsetvalue, std::function<void(std::shared_ptr<sh::filesystem::FilesystemNode>, QString link)> fctlinktriggered, int position, int valueWidthHint, )

Constructed only indirectly.

std::shared_ptr<PanelDetail> construct(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes, sh::filesystem::Operation *op)
class PanelDetailManager : public QObject, public sh::base::Singleton
#include <paneldetailmanager.h>

Manager for details provider as used in the details panel.

Register some code and data here for implementing a new provider.

Public Functions

QList<std::shared_ptr<PanelDetail>> getDetails(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)

Returns a list of PanelDetail for a list of selected filesystem nodes.

std::shared_ptr<PanelDetailFactory> registerFactorySingle(std::shared_ptr<PanelDetailFactory> factory)

Registers a panel detail factory for single selection by PanelDetailFactory instance.

std::shared_ptr<PanelDetailFactory> registerFactoryMulti(std::shared_ptr<PanelDetailFactory> factory)

Registers a panel detail factory for multi selection by PanelDetailFactory instance.

std::shared_ptr<PanelDetailFactory> registerFactorySingle(std::function<void(std::shared_ptr<PanelDetail>, std::shared_ptr<sh::filesystem::FilesystemNode>, sh::filesystem::Operation*)> fctsetvalue, std::function<void(std::shared_ptr<sh::filesystem::FilesystemNode>, QString link)> fctlinktriggered, int position, int valueWidthHint, )

Registers a panel detail factory for single selection by parameters.

std::shared_ptr<PanelDetailFactory> registerFactoryMulti(std::function<void(std::shared_ptr<PanelDetail>, QList<std::shared_ptr<sh::filesystem::FilesystemNode>>, sh::filesystem::Operation*)> fctsetvalue, std::function<void(QList<std::shared_ptr<sh::filesystem::FilesystemNode>>, QString link)> fctlinktriggered, int position, int valueWidthHint, )

Registers a panel detail factory for multi selection by parameters.

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

PanelDetailManager()

Private Members

QList<std::shared_ptr<PanelDetailFactory>> _factoriessingle
QList<std::shared_ptr<PanelDetailFactory>> _factoriesmulti
QMutex _mutex
class PanelDetailRow
#include <paneldetailmanager.h>

One pair of label text and value text in a panel detail.

Public Functions

PanelDetailRow(QString key, QList<PanelDetailRowValueElement> value)

Is intended to be directly constructed from everywhere.

PanelDetailRow(QList<PanelDetailRowValueElement> value)

Is intended to be directly constructed from everywhere.

QString key()
QList<PanelDetailRowValueElement> value()

Private Members

QString _key
QList<PanelDetailRowValueElement> _value
class PanelDetailRowValueElement
#include <paneldetailmanager.h>

One element of a detail row’s value.

This can be something like a string, an icon or a link button.

Public Functions

PanelDetailRowValueElement()

A placeholder for a value which is not yet arrived. It could be visualized with a loading animation or ‘…’. Is intended to be directly constructed from everywhere.

PanelDetailRowValueElement(QString text)

A piece of text. Is intended to be directly constructed from everywhere.

PanelDetailRowValueElement(QIcon icon)

An icon. Is intended to be directly constructed from everywhere.

PanelDetailRowValueElement(QString text, QString linktarget, bool autohide)

A link button. Is intended to be directly constructed from everywhere.

QString text()

Returns the text.

QIcon icon()

Returns the icon.

QString linktarget()

Returns the link target.

bool linkautohide()

Returns if this link shall automatically hide (e.g. when the mouse disappears).

bool isWaiting()

Returns if it is currently waiting for an update.

Private Members

QString _text
QIcon _icon
QString _linktarget
bool _linkautohide = false
bool _iswaiting = false
namespace scripting

The Shallot scripting interface.

Typedefs

using StringMap = QMap<QString, V>
class Api
#include <api.h>

Interoperation layer between the Shallot core and a plugin interpreter.

Public Functions

Api()
~Api()
QStringList classes()
QStringList rootMembers()
ApiClass *getClass(QString name)
ApiClass *getClassByTypeIdName(QString typeidName)
void *rootMember(QString name)
ApiClass *rootMemberClass(QString name)

Private Functions

void registerClass(QString name, ApiClass **apiclass, const std::type_info &nativeType)
void registerMethod(ApiClass *apiclass, QString name)
void registerRootObjectMember(QString name, ApiClass *cls, void *member)

Private Members

QHash<QString, ApiClass*> _classes
QHash<QString, ApiClass*> _classesByNativeType
QHash<QString, void*> _rootMembers
QHash<QString, ApiClass*> _rootMembersClasses
class ApiClass
#include <api.h>

Data structure for one api-aware core class.

Public Functions

ApiClass(QString name)

Constructed only indirectly.

~ApiClass()
QString name()
QStringList methods()
void addMethod(ApiMethod *m)
ApiMethod *getMethod(QString name)

Private Members

QString _name
QHash<QString, ApiMethod*> _methods
class ApiMethod
#include <api.h>

Data structure for one api-aware core method.

Public Functions

ApiMethod(QString name)

Constructed only indirectly.

QString name()
class PythonScriptInterpreter : public sh::scripting::ScriptInterpreter, public sh::base::Singleton
#include <pythonscriptinterpreter.h>

Integration of the Python language for scripting.

Find also the scripting manual for all details about the scripting interface.

Public Functions

~PythonScriptInterpreter()
bool isAvailable()
void initializeInterpreter()
QString filesuffix()
void execute(QString script)
void doInitialize()

Executes singleton initialization.

void shutdown()

Shutdown down this singleton.

bool isAlive()

Returns if this singleton is alive (true until its shutdown begins).

Public Members

PyObject *_Exception
PyObject *_CancelException
PyObject *_ThreadAbortException

Public Static Functions

void registerMethod(sh::scripting::ApiClass *clss, QString name, PyCFunction fctptr)
void throwNativeExceptionFromPythonTraceback()

Public Static Attributes

QHash<void*, PyObject*> _buddies
QHash<void*, std::weak_ptr<void>> _natives

Private Functions

PythonScriptInterpreter()

Private Static Functions

PyObject *getApiModuleDef()

Private Static Attributes

void *apiModuleDef
sh::scripting::Api *api = new sh::scripting::Api()
QHash<QString, PyCFunction> _methods
PyObject *modtraceback
class ScriptingEngine : public QObject, public sh::base::Singleton
#include <scriptingengine.h>

The Scripting engine loads scripts by means of the registered interpreters.

Public Functions

void loadScript(QString script)

Loads a plugin script from file.

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

ScriptingEngine()
void registerInterpreter(std::shared_ptr<sh::scripting::ScriptInterpreter> interpreter)

Private Members

QMap<QString, std::shared_ptr<sh::scripting::ScriptInterpreter>> _interpreters

Private Static Attributes

std::shared_ptr<sh::configuration::ConfigurationValue> cfgvalLastStartupFailed = sh::configuration::ConfigurationManager::instance()->registerConfigValue("sh::scripting::ScriptingEngine.LastStartupFailed", false, sh::configuration::ConfigurationValue::valueTypeBoolean())
class ActionPluginLoadCrashedAgain : public sh::actions::ActionActionItem

Public Functions

ActionPluginLoadCrashedAgain(QString path, QMutex *mutex)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ScriptedException : public sh::exceptions::Exception
#include <scriptingengine.h>

Exception for errors within the scripting engine and interpreters.

Public Functions

ScriptedException(sh::exceptions::ExceptionData data)
QString message() const
QString name() const
QString classes() const
QString details() const
QString callstack() const
QString auxiliary() const
QString customValue(QString key) const
bool isRuntimeException() const
bool isProgramException() const
bool isRetryable() const
bool isResumeable() const
bool isDetailsAreInteresting() const
int autoRetryRecommendedIn() const
void setResumeable(bool v)
void setReTryable(bool v)
void setCustomValue(QString key, QString value)
bool isClass(QString classname)
sh::exceptions::ExceptionData data()

Public Static Functions

template<class Handler>
std::shared_ptr<RegisterHandler<Handler>> createRegisterHandler(Handler handler, QStack<Handler> *stack)
void executeGuarded(std::function<void()> fctint flags = 0, )

Executes some code with some standard exection handling around.

Parameters
  • fct: The code to execute guarded.

  • flags: Flags of ExecuteGuardFlag for choosing the behavior.

void executeGuarded_errorpanel(std::function<void()> fctint flags = 0, )
QString _demangle(QString l)
void exceptionDialog(sh::exceptions::Exception &e, bool *doRetry)

Public Static Attributes

const QString UNDEFINED_ERROR_OCCURRED = QObject::tr("An unspecified error occurred.")
const QString SHALLOT_MUST_CLOSE_TEXT = QObject::tr("Your Shallot process is disturbed by an error and needs to be closed now. You can try if starting Shallot again solves the issue. If you are interested in technical details, please take a look at the log.")
const QString Value_isShallotException = "_isShallotException"
class ScriptInterpreter
#include <scriptingengine.h>

The base class for integration of a script language.

Subclassed by sh::scripting::PythonScriptInterpreter

Public Functions

bool isAvailable()
void initializeInterpreter()
QString filesuffix()
void execute(QString)
~ScriptInterpreter()
struct shallot_ShallotObject

A wrapper around a native object for the Python world.

Public Members

PyObject_HEAD void * nativeObject
std::shared_ptr<void> sharedNativeObject
bool isReallyShared
namespace api

Adapter functions and classes for interaction with scripting.

Some programming interfaces in the core are not directly usable for the scripting api. Scripting-friendly surrogates for them are here.

class ApiActionActionItem : public sh::actions::ActionActionItem
#include <apiaction.h>

Public Functions

ApiActionActionItem(QString text, bool enabled, QString icon, int defaultActionPrecedence)
void _execute()
void _initializeSync()
void action(sh::actions::ActionExecutionInfo *info) override

The action implementation, i.e. what the actions should actually do.

void initialize() override

Initialize the action. This should make the time-consuming parts, e.g. for determining a label or enabled state.

void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Public Members

std::function<void()> _initialize
std::function<void(sh::actions::ActionExecutionInfo*)> _action

Signals

void changed()

Emits when some data changed.

class ApiActionFactory : public sh::actions::AbstractActionFactory
#include <apipredicatedactionfactory.h>

Public Functions

ApiActionFactory(QString category, QList<std::shared_ptr<actions::Predicate>> predicates)
std::shared_ptr<sh::actions::AbstractActionItem> construct(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
std::shared_ptr<ActionInstantiation> actionAvailable(ActionInstantiation *instantiation)

Public Members

std::function< std::shared_ptr< sh::actions::AbstractActionItem >QList< std::shared_ptr< sh::filesystem::FilesystemNode > > nodes)> _construct
class ApiDetailColumn : public sh::filesystem::DetailColumn
#include <apidetailcolumn.h>

Public Functions

ApiDetailColumn(QString name, QString displayName, int displayIndex, bool sort_doTypediff, int defaultWidth, bool isRightAligned)
QVariant determineValue(std::shared_ptr<sh::filesystem::FilesystemNode> node, sh::filesystem::Operation *op)
void applyValue(std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::Operation *op, QVariant value)
QString name()

The internal unique name.

QString displayName()

The display name.

bool isValueAvailable(std::shared_ptr<FilesystemNode> node)

Checks if a value for this detail is available for one given node.

QVariant value(std::shared_ptr<FilesystemNode> node, bool ignoreAged = false)

Returns the value for this detail for one given node.

Parameters
  • ignoreAged: If no value should be returned which is older than the last request (not useful for nearly all cases).

QString displayValue(std::shared_ptr<FilesystemNode> node, const sh::filesystem::FilesystemModelFileviewProxy *viewmodel)

Returns the stringified value for this details for one given node considering the configuration of a view.

bool isVisible()

If this detail shall be a visible column in the view.

QVariant requestValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op = 0, bool withNodeValues = false, bool withOperationsCache = true)

Requests to determine the value for this detail for one given node. Blocks until the value is available. Get it with the value method afterwards.

bool sort_doTypediff()

If sorting should separate files and directories.

int sort_order(std::shared_ptr<FilesystemNode> n1, std::shared_ptr<FilesystemNode> n2)

The sorting order.

uint displayIndex()

Controls which place this column should get in the user interface.

QVariant computeValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op)

Returns a freshly determined value for this column and the given node. It neither asks nor populates any caches or storages.

int defaultWidth()
bool isRightAligned()
void applyValueByEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given eurl (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

void applyValueByNode(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given node (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

Public Members

std::function<QString(std::shared_ptr<sh::filesystem::FilesystemNode>, sh::filesystem::Operation*)> _determineValue
std::function<void(std::shared_ptr<sh::filesystem::Eurl>, sh::filesystem::Operation*, QString)> _applyValue

Public Static Functions

QVariant VALUE_UNAVAILABLE()

A special value expressing that the value is not yet available.

void registerKnownDetailColumn(QString name, std::shared_ptr<DetailColumn> column)
std::shared_ptr<DetailColumn> findKnownDetailColumn(QString name)

Public Static Attributes

const uint DISPLAYINDEX_CORE = 10000
const uint DISPLAYINDEX_INTERESTING = 20000
const uint DISPLAYINDEX_EXOTIC = 30000
class ApiFilePropertyDialogTab : public sh::ui::FilePropertyDialogTab
#include <apifilepropertydialogtab.h>

Public Functions

ApiFilePropertyDialogTab(QString title, QList<PropertyConfig> properties)
QString title() override

The tab title. .

QList<QString> properties() override

Returns the list of property labels (one entry for each widget).

Each property is displayed with a header and a widget (created in createWidget) with some content (populated in updateWidget).

void populateWidget(int i, sh::ui::FilePropertyDialogTabActionsView *widget) override

Populates the tab widget for the i-th property.

Typically uses the FilePropertyDialog::create* methods to create sub-widgets.

See also dialog().

void updateWidget(int i, sh::ui::FilePropertyDialogTabActionsView *widget, sh::filesystem::Operation *op) override

Populates the widget for the i-th property with actual content. .

QString titleWithoutMnemonic()

The tab title without mnemonic.

void refresh()

Refreshes the complete content.

Typically called after some user actions in a property widget require that all the other content must be refreshed.

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes()

The nodes to show.

FilePropertyDialogTabActionsView *widgetAt(int i)

Returns the widget for the i-th property.

int widgetCount()

Returns the number of widgets.

std::shared_ptr<FilePropertyDialog> dialog()

Returns the associated dialog.

Public Members

std::function< QList< QString >int, sh::filesystem::Operation *, qintptr)> _updateWidget
std::function<void(QString)> _buttonTriggered

Public Static Attributes

const int PROPERTY_TYPE_STRING = 1
const int PROPERTY_TYPE_STRINGMAP = 2
const int PROPERTY_TYPE_ICONTEXTBANNER = 3

Private Types

typedef QPair<QString, QString> StringPair

Private Members

QString _title
QList<PropertyConfig> _properties
class PropertyConfig
#include <apifilepropertydialogtab.h>

Public Types

typedef QPair<QString, QString> ButtonConfig

Public Functions

PropertyConfig(QString title, int propertytype, QList<ButtonConfig> buttons)

Public Members

QString title
int propertytype
QList<ButtonConfig> buttons
class ApiFilePropertyDialogTabFactory : public sh::ui::FilePropertyDialogTabFactory
#include <apifilepropertydialogtab.h>

Public Functions

ApiFilePropertyDialogTabFactory()
std::shared_ptr<sh::ui::FilePropertyDialogTab> construct(std::shared_ptr<sh::ui::FilePropertyDialog> dialog)
std::shared_ptr<sh::ui::FilePropertyDialogTab> construct(std::shared_ptr<sh::ui::FilePropertyDialog> dialog) = 0

Constructs a fresh instance of a FilePropertyDialogTab implementation. .

Public Members

std::function< std::shared_ptr< sh::scripting::api::ApiFilePropertyDialogTab >)> _construct

Public Static Attributes

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_CORE = 10000

Base value for display indexes of core (i.e. maximum important) tabs.

Used in FilePropertyDialog::addTabFactory.

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_VERYIMPORTANT = 20000

Base value for display indexes of very important tabs.

Used in FilePropertyDialog::addTabFactory.

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_IMPORTANT = 30000

Base value for display indexes of important tabs.

Used in FilePropertyDialog::addTabFactory.

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_NORMAL = 40000

Base value for display indexes of tabs with medium importance.

Used in FilePropertyDialog::addTabFactory.

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_EXOTIC = 50000

Base value for display indexes of exotic (i.e. less important) tabs.

Used in FilePropertyDialog::addTabFactory.

class ApiFilesystemHandler : public sh::filesystem::FilesystemHandler
#include <apifilesystemhandler.h>

Public Functions

ApiFilesystemHandler(sh::filesystem::FilesystemModel *model)
void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list)
void configureItems(sh::filesystem::Operation *op, QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time)
QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QList<QString> listExtendedAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
quint64 getExtendedAttributeSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)
QByteArray getExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)
void setExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QByteArray value)
void removeExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)
QMap<QString, QString> getCustomAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void setCustomAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QString value)
bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target)
bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer)
bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src)
void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath)
QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls)
void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list) = 0

Determine a list of subelements in a certain directory.

void configureItems(sh::filesystem::Operation *op, QList<std::shared_ptr<FilesystemNode>> nodes)

Configure newly created nodes (e.g. setting another icon or changing the display name).

sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine if a file is regular, or a dir, or a link, …

qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the size of a file.

QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the mtime of a file.

void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time) = 0

Set the mtime of a file.

QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine mime type of a file.

QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Resolve a link.

QList<QString> listExtendedAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Fetches the list of available extended attributes for an entry.

quint64 getExtendedAttributeSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the site of value for one extended attribute for an entry.

QByteArray getExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the value for one extended attribute for an entry.

void setExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QByteArray value)

Sets the value for one extended attribute for an entry.

void removeExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Removes one extended attributes for an entry.

QMap<QString, QString> getCustomAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Returns the custom attributes for an entry.

In contrast to extended attributes, the custom attributes are not directly stored in the filesystem this way, but handle implementation specific aspects (like permissions).

void setCustomAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QString value)

Sets the value for one custom attribute for an entry.

See also getCustomAttributes.

bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to get the content of a certain file.

std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Get the content of a file.

bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create subdirectories in a certain directory.

void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Create a directory.

bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create a link in a certain directory.

void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target) = 0

Create a link.

bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create files in a certain directory.

void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer) = 0

Creates a file with some content.

It may use handlertransfer for some better integration, like cancel support and progress monitoring.

bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to delete a certain file/directory/link/….

void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Delete a file/directory/link/…

void deleteDirectoryIfEmpty(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Deletes a directory only of it is empty.

bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src) = 0

Returns if it is allowed to rename a certain file, directory, link, … (see renameItem).

void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath) = 0

Renames an item to another path.

It can be a simple filename change or also changes in the deeper path segments.

QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) = 0

Returns a list of actions (see former example) for showing for certain files.

bool requiresResolvedLinks()

Returns if this handler requires to be used by the engine with resolved links.

void viewEnteredDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view entered some directory (e.g. for enabling watchers). See also viewLeftDirectory.

void viewLeftDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view left some directory. See also viewEnteredDirectory.

bool isWellKnownScheme()

Returns if the scheme for this handler is a well known one (which external programs typically would understand).

void search(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>, QList<std::shared_ptr<sh::search::SearchCriterion>>, sh::filesystem::FilesystemNodeType ftype)> addfile, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>)> visitdir, QList<std::shared_ptr<sh::search::SearchCriterion>> criteria, )

Helps searching for files.

Override this method with a behavior identical to the default, if a specialized implementation can be much faster than the default one.

void customizeUi(std::shared_ptr<sh::filesystem::FilesystemNode> node, bool *showSearchPanel)

Creates a custom gui, which becomes part of the fileview.

sh::filesystem::FilesystemModel *model()

A convenience shortcut to the sh::filesystem::FilesystemModel (a singleton).

Public Members

std::function<int(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _getType
std::function<qint64(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _getSize
std::function<double(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _getMtime
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl, double)> _setMtime
std::function<QString(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _getLinkTarget
std::function< QList< QString >sh::filesystem::Operation *op, std::shared_ptr< sh::filesystem::Eurl > eurl)> _listExtendedAttributes
std::function<quint64(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl, QString attribute)> _getExtendedAttributeSize
std::function<QByteArray(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl, QString attribute)> _getExtendedAttribute
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl, QString attribute, QByteArray value)> _setExtendedAttribute
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl, QString attribute)> _removeExtendedAttribute
std::function< QList< QString >sh::filesystem::Operation *op, std::shared_ptr< sh::filesystem::Eurl > eurl)> _getCustomAttributes
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl, QString attribute, QString value)> _setCustomAttribute
std::function<QString(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _getMimetype
std::function<bool(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _canCreateDirectory
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _createDirectory
std::function<bool(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _canCreateLink
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl, QString target)> _createLink
std::function<bool(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _canCreateFile
std::function<bool(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _canDeleteItem
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _deleteItem
std::function<bool(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> src)> _canRenameItem
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> src, QString destpath)> _renameItem
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl, int type, sh::filesystem::FilesystemNodeListEditor *list)> _itemlist
std::function<void(sh::filesystem::Operation *op, QList<std::shared_ptr<sh::filesystem::FilesystemNode>>)> _configureItems
std::function<bool(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _canGetFileContent
std::function< std::shared_ptr< QIODevice >sh::filesystem::Operation *op, std::shared_ptr< sh::filesystem::Eurl > eurl)> _getFileContent
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer)> _createFile
std::function< QList< std::shared_ptr< sh::actions::AbstractActionItem > >QList< std::shared_ptr< sh::filesystem::Eurl > > eurls)> _getActions
class ApiFilesystemOperationProgressMonitor : public sh::filesystem::FilesystemOperationProgressMonitor
#include <apifilesystemoperationprogressmonitor.h>

Public Functions

ApiFilesystemOperationProgressMonitor(sh::actions::ActionExecutionInfo *actionExecution)
bool hasItemInfo()

Checks if this progress monitor provides information about how many items of a certain total number are transferred so far.

quint64 doneItems()

Checks how many items are transferred so far.

quint64 allItems()

Checks how many items are to be transferred in total (as predicted in the current moment).

bool hasBytesInfo()

Checks if this progress monitor provides information about how many byte of a certain total number are transferred so far.

quint64 doneBytes()

Checks how many bytes are transferred so far.

quint64 allBytes()

Checks how many bytes are to be transferred in total (as predicted in the current moment).

QString getItemInfoFrom()

Returns the current source of transfer (as textual information).

QString getItemInfoTo()

Returns the current destination of transfer (as textual information).

QString estimation()

Returns the current performance and time estimation (as textual information).

Public Members

std::function<void()> _changed
std::function<bool(QList<sh::filesystem::FilesystemOperationTransfers::OperationStep*>)> _resolveConflicts
class ApiGlobalObject : public sh::base::Singleton
#include <apiglobalobject.h>

Public Functions

std::shared_ptr<const sh::filesystem::Eurl> getEurlFromString(QString eurl)
void logDebug(QString msg)
void logInfo(QString msg)
void logWarning(QString msg)
void logError(QString msg)
int filesystemnodetype_file()
int filesystemnodetype_directory()
int filesystemnodetype_link()
int filesystemnodetype_unknown()
int filesystemnodetype_firsttype()
int filesystemnodetype_lastphysicaltype()
int filesystemnodetype_none()
int filesystemnodetype_specialtreeonlydirectory()
int filesystemnodetype_lasttype()
int actiondefaultprecedencevalues_openfile()
int actiondefaultprecedencevalues_builtinspecialopen()
int messageboxbutton_ok()
int messageboxbutton_continue()
int messageboxbutton_cancel()
int messageboxbutton_retry()
int messageboxbutton_yes()
int messageboxbutton_no()
int displayindex_core()
int displayindex_interesting()
int displayindex_exotic()
int configurationcategory_gui()
int configurationcategory_behavior()
int configurationcategory_externaltools()
int settinggroup_global()
int settinggroup_gui()
int settinggroup_filehandling()
int settinggroup_dataview()
int settinggroup_behavior()
int settinggroup_special()
int paneldetail_positionindex_veryinteresting()
int paneldetail_positionindex_interesting()
int paneldetail_positionindex_exotic()
int operationstep_conflictresolution_mergedirectories()
int operationstep_conflictresolution_overwritedestination()
int operationstep_conflictresolution_renamedestinationbefore()
int operationstep_conflictresolution_skip()
int operationstep_conflictresolution_unresolved()
int operationstep_conflictresolution_indirect()
int operationstep_conflictresolution_usedifferentdestinationname()
int filepropertydialogtab_index_core()
int filepropertydialogtab_index_veryimportant()
int filepropertydialogtab_index_important()
int filepropertydialogtab_index_normal()
int filepropertydialogtab_index_exotic()
int filepropertydialogtab_propertytype_string()
int filepropertydialogtab_propertytype_stringmap()
int filepropertydialogtab_propertytype_icontextbanner()
int searchcriterionfactory_index_core()
int searchcriterionfactory_index_normal()
int searchcriterionfactory_index_exotic()
int thumbnailprovider_index_core()
int thumbnailprovider_index_normal()
int thumbnailprovider_index_exotic()
int thumbnailprovider_index_fallback()
void register_predicatedactionfactory(std::shared_ptr<sh::scripting::api::ApiActionFactory> f)
bool isDebugBuild()
std::shared_ptr<sh::scripting::api::ApiFilesystemHandler> create_FilesystemHandler()
std::shared_ptr<sh::scripting::api::ApiActionActionItem> create_ActionActionItem(QString text, bool enabled, QString icon, int defaultActionPrecedence)
std::shared_ptr<sh::scripting::api::ApiSubmenuActionItem> create_SubmenuActionItem(QString text, bool enabled, QString icon, int defaultActionPrecedence)
std::shared_ptr<sh::scripting::api::ApiDetailColumn> create_DetailColumn(QString name, QString displayName, int displayIndex, bool sort_doTypediff, int defaultWidth, bool isRightAligned)
std::shared_ptr<sh::scripting::api::ApiFilePropertyDialogTab> create_FilePropertyDialogTab(QString title, QList<QString> properties)
std::shared_ptr<sh::scripting::api::ApiFilePropertyDialogTabFactory> create_FilePropertyDialogTabFactory()
std::shared_ptr<sh::scripting::api::ApiActionFactory> create_ActionFactory(QString category, QList<std::shared_ptr<actions::Predicate>> predicates)
std::shared_ptr<sh::scripting::api::ApiPanelDetailFactorySingle> create_DetailFactorySingle(int position, int valueWidthHint)
std::shared_ptr<sh::scripting::api::ApiPanelDetailFactoryMulti> create_DetailFactoryMulti(int position, int valueWidthHint)
std::shared_ptr<sh::scripting::api::ApiFilesystemOperationProgressMonitor> create_FilesystemOperationProgressMonitor(sh::actions::ActionExecutionInfo *actionExecution)
std::shared_ptr<sh::filesystem::FilesystemNode> _createFilesystemNode(std::shared_ptr<sh::filesystem::Eurl> eurl, sh::scripting::api::ApiFilesystemHandler *handler, int nodetype, std::shared_ptr<sh::filesystem::FilesystemNode> parent, bool doinsert, bool showInitialLoadingLabel, bool isHidden)
std::shared_ptr<sh::scripting::api::ApiThumbnailProvider> create_ThumbnailProvider()
std::shared_ptr<sh::filesystem::FilesystemNode> _getOrCreateFilesystemNode(std::shared_ptr<sh::filesystem::Eurl> eurl, sh::scripting::api::ApiFilesystemHandler *handler, int nodetype, std::shared_ptr<sh::filesystem::FilesystemNode> parent, bool doinsert, bool showInitialLoadingLabel, bool isHidden)
void _register_FilesystemHandler(std::shared_ptr<sh::scripting::api::ApiFilesystemHandler> handler, QString scheme)
std::shared_ptr<sh::filesystem::FilesystemNode> modelRootNode()
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> _findFilesystemNodesForEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> _tryGetFilesystemNodesForEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)
void refreshData(std::shared_ptr<const sh::filesystem::Eurl> eurl, bool forceFindParent, bool withDetails)
std::shared_ptr<filesystem::Eurl> createEurl(QString scheme, QString hostname, QString path)
std::shared_ptr<sh::filesystem::Operation> createOperation()
sh::scripting::StringMap<QString> createArgumentException()
sh::scripting::StringMap<QString> createIOException()
sh::scripting::StringMap<QString> createRuntimeException()
sh::scripting::StringMap<QString> createProgramException()
sh::scripting::StringMap<QString> createException()
std::shared_ptr<sh::scripting::api::ApiReadDataDevice> _createReadDataDevice()
std::shared_ptr<ApiSetting> createSetting(QString name, QString description, int group, bool isAdvancedSetting, bool isGlobal, bool isPerFileview)
std::shared_ptr<sh::scripting::api::ApiThread> create_Thread()
std::shared_ptr<sh::scripting::api::ApiTimer> create_Timer()
std::shared_ptr<sh::scripting::api::ApiSearchCriterion> create_SearchCriterion(std::shared_ptr<sh::scripting::api::ApiSearchCriterionFactory> factory)
std::shared_ptr<sh::scripting::api::ApiSearchCriterionFactory> create_SearchCriterionFactory(QString key, QString description)
sh::ui::MainWindow *mainwindow()
void registerPanelDetailFactorySingle(std::shared_ptr<sh::scripting::api::ApiPanelDetailFactorySingle>)
void registerPanelDetailFactoryMulti(std::shared_ptr<sh::scripting::api::ApiPanelDetailFactoryMulti>)
void registerSetting(std::shared_ptr<sh::settings::Setting> setting)
void openItems(QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls)
void registerFilePropertyDialogTabFactory(int index, std::shared_ptr<sh::scripting::api::ApiFilePropertyDialogTabFactory>)
void registerThumbnailProvider(int idx, std::shared_ptr<sh::scripting::api::ApiThumbnailProvider> thumbnailprovider)
void registerSearchCriterionFactory(int idx, std::shared_ptr<ApiSearchCriterionFactory> apicrit)
std::shared_ptr<sh::configuration::ConfigurationValue> register_ConfigurationValueInt(QString name, int deflt, QString desc, int category, QString longdesc, QString changehint)
std::shared_ptr<sh::configuration::ConfigurationValue> register_ConfigurationValueFloat(QString name, int deflt, QString desc, int category, QString longdesc, QString changehint)
std::shared_ptr<sh::configuration::ConfigurationValue> register_ConfigurationValueBool(QString name, bool deflt, QString desc, int category, QString longdesc, QString changehint)
std::shared_ptr<sh::configuration::ConfigurationValue> register_ConfigurationValueString(QString name, QString deflt, QString desc, int category, QString longdesc, QString changehint)
void registerTransferrableDetailColumn(int i, std::shared_ptr<sh::filesystem::DetailColumn> detailColumn)
std::shared_ptr<sh::filesystem::DetailColumn> findDetailColumnByName(QString name)
QString shallotDataDir()
QString shallotBuiltinPluginDir()
QString shallotSystemPluginDir()
QString shallotUserPluginDir()
QString shallotLanguage()
sh::tools::BookmarkManager *bookmarkManager()
std::shared_ptr<sh::actions::Predicate> create_OnDirectoriesPredicate()
std::shared_ptr<sh::actions::Predicate> create_OnFilesPredicate()
std::shared_ptr<sh::actions::Predicate> create_OnLinksPredicate()
std::shared_ptr<sh::actions::Predicate> create_OnSingleEntrySelectionPredicate()
std::shared_ptr<sh::actions::Predicate> create_DontResolveLinksPredicate()
std::shared_ptr<sh::actions::Predicate> create_HideOnCurrentDirectoryLevelPredicate()
std::shared_ptr<sh::actions::Predicate> create_HideOnSelectionLevelPredicate()
std::shared_ptr<sh::actions::Predicate> create_ByRegExpPredicate(QString pattern)
std::shared_ptr<sh::actions::Predicate> create_KeyShortcutPredicate(QString shortcut, bool triggersOnCurrentDirectoryLevel)
std::shared_ptr<sh::actions::Predicate> create_PositionIndexPredicate(int index)
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

ApiGlobalObject()
class ApiHelperMethods
#include <apihelpermethods.h>

Public Static Functions

QByteArray QIODevice_read(QIODevice *self)
QByteArray QIODevice_readall(QIODevice *self)
QByteArray ApiReadDataDevice_read(sh::scripting::api::ApiReadDataDevice *self)
QByteArray ApiReadDataDevice_readall(sh::scripting::api::ApiReadDataDevice *self)
void FilesystemNodeList_resetItems(sh::filesystem::FilesystemNodeList *self, int type, QList<std::shared_ptr<sh::filesystem::FilesystemNode>> list)
void FilesystemNode_addDetail(filesystem::FilesystemNode *self, std::shared_ptr<sh::filesystem::DetailColumn> col)
void FilesystemNode_setIcon(sh::filesystem::FilesystemNode *self, QString icon)
void FilesystemNode_setDisplayName(filesystem::FilesystemNode *self, QString displayname)
bool FilesystemNode_isHidden(filesystem::FilesystemNode *self)
void FilesystemNode_setHidden(filesystem::FilesystemNode *self, bool v)
void ConfigurationValue_setConfigValueInt(sh::configuration::ConfigurationValue *self, int v)
void ConfigurationValue_setConfigValueFloat(sh::configuration::ConfigurationValue *self, double v)
void ConfigurationValue_setConfigValueBool(sh::configuration::ConfigurationValue *self, bool v)
void ConfigurationValue_setConfigValueString(sh::configuration::ConfigurationValue *self, QString v)
QList<std::shared_ptr<sh::filesystem::Eurl>> FilesystemOperation_itemlist(sh::filesystem::FilesystemOperation *self, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QList<std::shared_ptr<sh::filesystem::Eurl>> FilesystemOperation_itemlistByType(sh::filesystem::FilesystemOperation *self, std::shared_ptr<const sh::filesystem::Eurl> eurl, int ntype)
int FilesystemOperation_getType(sh::filesystem::FilesystemOperation *self, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void FilesystemOperation_createFile(sh::filesystem::FilesystemOperation *self, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::scripting::api::ApiReadDataDevice *content, std::shared_ptr<filesystem::FilesystemOperationProgressMonitor> progressmon)
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> FilesystemOperation_resolveNodeLink(sh::filesystem::FilesystemOperation *self, std::shared_ptr<sh::filesystem::FilesystemNode> node)
std::shared_ptr<sh::filesystem::Eurl> FilesystemOperation_resolveEurlLink(sh::filesystem::FilesystemOperation *self, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void PanelDetail_setRow(sh::paneldetails::PanelDetail *self, QString key, QList<QString> value)
void MainWindow_jumpToEurl(sh::ui::MainWindow *self, std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<sh::filesystem::FilesystemNode> MainWindow_getCurrentDirectoryNode(sh::ui::MainWindow *self)
void ApiActionActionItem_setEnabled(sh::scripting::api::ApiActionActionItem *self, bool enabled)
bool ApiActionActionItem_enabled(sh::scripting::api::ApiActionActionItem *self)
void ApiActionActionItem_setVisible(sh::scripting::api::ApiActionActionItem *self, bool visible)
bool ApiActionActionItem_visible(sh::scripting::api::ApiActionActionItem *self)
void ApiSubmenuActionItem_setSubitems(sh::scripting::api::ApiSubmenuActionItem *self, QList<std::shared_ptr<actions::AbstractActionItem>> subitems)
void ApiSubmenuActionItem_setEnabled(sh::scripting::api::ApiSubmenuActionItem *self, bool enabled)
bool ApiSubmenuActionItem_enabled(sh::scripting::api::ApiSubmenuActionItem *self)
void ApiSubmenuActionItem_setVisible(sh::scripting::api::ApiSubmenuActionItem *self, bool visible)
bool ApiSubmenuActionItem_visible(sh::scripting::api::ApiSubmenuActionItem *self)
int OperationStep_conflictResolution(filesystem::FilesystemOperationTransfers::OperationStep *self)
bool FilesystemOperationProgressMonitor_hasItemInfo(sh::scripting::api::ApiFilesystemOperationProgressMonitor *self)
quint64 FilesystemOperationProgressMonitor_doneItems(sh::scripting::api::ApiFilesystemOperationProgressMonitor *self)
quint64 FilesystemOperationProgressMonitor_allItems(sh::scripting::api::ApiFilesystemOperationProgressMonitor *self)
bool FilesystemOperationProgressMonitor_hasBytesInfo(sh::scripting::api::ApiFilesystemOperationProgressMonitor *self)
quint64 FilesystemOperationProgressMonitor_doneBytes(sh::scripting::api::ApiFilesystemOperationProgressMonitor *self)
quint64 FilesystemOperationProgressMonitor_allBytes(sh::scripting::api::ApiFilesystemOperationProgressMonitor *self)
QString FilesystemOperationProgressMonitor_getItemInfoFrom(sh::scripting::api::ApiFilesystemOperationProgressMonitor *self)
QString FilesystemOperationProgressMonitor_getItemInfoTo(sh::scripting::api::ApiFilesystemOperationProgressMonitor *self)
QString FilesystemOperationProgressMonitor_estimation(sh::scripting::api::ApiFilesystemOperationProgressMonitor *self)
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> ApiFilePropertyDialogTab_nodes(sh::scripting::api::ApiFilePropertyDialogTab *self)
int ActionExecutionUserFeedback_messageBox(sh::actions::ActionExecutionUserFeedback *self, QString m, QList<QString> l, QString s, int i, int j)
QString ActionExecutionUserFeedback_simpleInputBox(sh::actions::ActionExecutionUserFeedback *self, QString text, QString deflt)
int FilePropertyDialogTab_selectedIndexForProperty(ApiFilePropertyDialogTab *self, qintptr widget)
void FilePropertyDialogTab_refresh(ApiFilePropertyDialogTab *self)
class ApiPanelDetailFactoryMulti : public sh::paneldetails::PanelDetailFactoryForFunctionMulti
#include <apipaneldetailfactory.h>

Public Functions

ApiPanelDetailFactoryMulti(int position, int valueWidthHint)
void setvalue(std::shared_ptr<sh::paneldetails::PanelDetail> detail, QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes, filesystem::Operation *op)
void linktriggered(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes, QString linktarget)
std::shared_ptr<PanelDetail> construct(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes, sh::filesystem::Operation *op)

Public Members

std::function<void(sh::paneldetails::PanelDetail*, QList<std::shared_ptr<sh::filesystem::FilesystemNode>>, sh::filesystem::Operation *op)> _setvalue
std::function<void(QList<std::shared_ptr<sh::filesystem::FilesystemNode>>, QString)> _linktriggered
class ApiPanelDetailFactorySingle : public sh::paneldetails::PanelDetailFactoryForFunctionSingle
#include <apipaneldetailfactory.h>

Public Functions

ApiPanelDetailFactorySingle(int position, int valueWidthHint)
void setvalue(std::shared_ptr<sh::paneldetails::PanelDetail>, std::shared_ptr<sh::filesystem::FilesystemNode> node, filesystem::Operation *op)
void linktriggered(std::shared_ptr<sh::filesystem::FilesystemNode> node, QString linktarget)
std::shared_ptr<PanelDetail> construct(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes, sh::filesystem::Operation *op)

Public Members

std::function<void(sh::paneldetails::PanelDetail*, std::shared_ptr<sh::filesystem::FilesystemNode>, sh::filesystem::Operation *op)> _setvalue
std::function<void(std::shared_ptr<sh::filesystem::FilesystemNode>, QString)> _linktriggered
class ApiReadDataDevice : public sh::tools::ReadDataDevice
#include <apireaddatadevice.h>

Public Functions

ApiReadDataDevice()
QByteArray getdata()

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. .

void _ended()

Public Members

std::function<QByteArray()> _getdata

Private Members

bool isended
class ApiSearchCriterion : public sh::search::criteria::AbstractActionDrivenSearchCriterion
#include <apisearchcriterion.h>

Public Functions

ApiSearchCriterion(std::shared_ptr<sh::search::SearchCriterionFactory> factory)
bool match2(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QList<QString> getsearchspec()
bool match(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Checks if a given file (by eurl) matches this criterion. .

QString valuedescription()

Returns a human readable text describing the current criterion shortly and precisely. .

QString serialize()

Serializes this criterion to a string. See also SearchCriterion::deserialize.

std::shared_ptr<sh::search::SearchCriterionFactory> factory()

Returns the factory this criterion has created (provides some more metadata).

Public Members

std::function<void(sh::actions::ActionExecutionInfo*)> _configure
std::function<bool(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _match
QStringList searchspec

Public Static Functions

void _createEditor(std::shared_ptr<sh::search::SearchCriterion> cfg, sh::ui::SearchPanelConfiguration *panelcfg)
void _editorUpdateConfiguration(sh::ui::SearchPanelConfiguration *panelcfg, std::shared_ptr<sh::search::SearchCriterion> c)
std::shared_ptr<sh::search::SearchCriterion> deserialize(QString s)

Deserializes this criterion from a string. See also SearchCriterion::serialize.

class ApiSearchCriterionFactory : public sh::search::SearchCriterionFactory
#include <apisearchcriterion.h>

Public Functions

ApiSearchCriterionFactory(QString key, QString description)
QString key()

Returns the string key for the associated search criterion class. .

QString description()

Returns the description string for the associated search criterion class. .

void editor(std::shared_ptr<sh::search::SearchCriterion> c, sh::ui::SearchPanelConfiguration *panelcfg)
void editorupdateconfig(sh::ui::SearchPanelConfiguration *panelcfg, std::shared_ptr<sh::search::SearchCriterion> c)
std::shared_ptr<sh::search::SearchCriterion> construct()

Constructs an instance of the associated search criterion class. .

bool isVisibleFor(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::FilesystemNode> node)

Checks if the associated search criterion class should be offered to the user for a given node. .

void editor(std::shared_ptr<sh::search::SearchCriterion> c, sh::ui::SearchPanelConfiguration *panelcfg) = 0

Builds the search config ui in a search panel.

Takes the data from c and populates panelcfg with it.

void editorupdateconfig(sh::ui::SearchPanelConfiguration *panelcfg, std::shared_ptr<sh::search::SearchCriterion> c) = 0

Updates own data with the content from the search config ui in a search panel.

Takes the data from panelcfg and updates c with it.

Public Members

std::function<QString(QList<QString>)> _getsearchspecdesc
std::function< std::shared_ptr< sh::search::SearchCriterion >)> _construct
std::function<bool(sh::filesystem::Operation*, std::shared_ptr<sh::filesystem::FilesystemNode>)> _isVisibleFor
class ApiSetting : public sh::settings::Setting
#include <apisetting.h>

Public Functions

ApiSetting(QString name, QString description, sh::settings::SettingGroup group, bool isAdvancedSetting, bool isGlobal, bool isPerFileview)
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(QString value)

Called from Shallot core when the value was set (for a not-per-fileview setting).

void setValue(sh::ui::FileView *filelist, QString value)

Called from Shallot core when the value was set (for a per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

Public Members

std::function<void(QString)> _setValue1
std::function<void(int, QString)> _setValue2
std::function<QString(int)> _getValue
std::function<QString(QString)> _valueDescription
QString _name
QString _description
sh::settings::SettingGroup _group
bool _isAdvancedSetting
bool _isGlobal
bool _isPerFileview

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class ApiSubmenuActionItem : public sh::actions::SubmenuActionItem
#include <apiaction.h>

Public Functions

ApiSubmenuActionItem(QString text, bool enabled, QString icon, int defaultActionPrecedence)
void initialize() override

Initialize the action. This should make the time-consuming parts, e.g. for determining a label or enabled state.

const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems()

Returns the list of subitems from this submenu.

void setSubitems(const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems)

Sets the subitems.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Public Members

std::function<void()> _initialize

Signals

void subitemsChanged()

Emits when the list of subitems changed.

void changed()

Emits when some data changed.

class ApiThread : public std::enable_shared_from_this<ApiThread>
#include <apithread.h>

Public Functions

ApiThread()
void start()

Public Members

std::function<void()> _run
class ApiThumbnailProvider : public sh::tools::ThumbnailProvider
#include <apithumbnailprovider.h>

Public Functions

ApiThumbnailProvider()
void getThumbnail(sh::filesystem::Operation *operation, std::shared_ptr<sh::filesystem::FilesystemNode> node, QString contentType, int width, int height, QIcon *icon)

Public Members

std::function<QByteArray(sh::filesystem::Operation*, std::shared_ptr<sh::filesystem::FilesystemNode>, QString, int, int)> _getThumbnail
class ApiTimer : public std::enable_shared_from_this<ApiTimer>
#include <apitimer.h>

Public Functions

ApiTimer()
void start(int interval)
void stop()

Public Members

std::function<void()> _run

Private Members

QMutex _mutex
QTimer _timer
bool _isexecuting = false
QList<std::shared_ptr<ApiTimer>> _runningTimers
namespace pythoninterop

Interoperation layer between the Shallot core (C++) and Python plugins.

Typedefs

using StringMap = QMap<QString, V>

Functions

PyObject *getPyNone()
bool isPyNone(PyObject *o)
void *getPointerFromShallotPyObject(PyObject *o)
std::shared_ptr<void> getSharedPointerFromShallotPyObject(PyObject *o)
PyObject *getShallotPyObjectFromPointer(void *o, sh::scripting::ApiClass *apiclass)
PyObject *getShallotPyObjectFromSharedPointer(std::shared_ptr<void> o, sh::scripting::ApiClass *apiclass)
sh::scripting::ApiClass *getApiClass(QString typeIdName)
PyObject *PyTupleGetItem(PyObject *o, int itm)
PyObject *PyListGetItem(PyObject *o, int itm)
int PyTupleCount(PyObject *o)
int PyListCount(PyObject *o)
bool PyIsTuple(PyObject *o)
bool PyIsList(PyObject *o)
bool PyIsUnicode(PyObject *o)
bool PyIsBytes(PyObject *o)
bool PyIsDict(PyObject *o)
bool PyIsBool(PyObject *o)
bool PyIsFloat(PyObject *o)
bool PyIsLong(PyObject *o)
void PyIncRef(PyObject *o)
void PyDecRef(PyObject *o)
void PyTupleSetItem(PyObject *o, int itm, PyObject *val)
PyObject *PyObjectCall(PyObject *fct, PyObject *args)
PyObject *PyTupleNew(int cnt)
PyObject *PyDictNew()
PyObject *PyDictKeys(PyObject *o)
PyObject *PyDictGetItem(PyObject *dict, PyObject *key)
void PyDictSetItem(PyObject *dict, PyObject *key, PyObject *val)
bool PythonToC_ExecuteGuarded(std::function<void()> fct)
void invokePython(std::function<void()> fct)
template<typename R, typename T, typename ...ArgsF, typename ...ArgsT>
R CallNativeFunctionWithTuple(T *pObj, R (T::* f)(ArgsF...), std::tuple<ArgsT...> const &t, )
template<typename R, typename T, typename ...ArgsF, typename ...ArgsT>
R CallNativeHelperFunctionWithTuple(T *pObj, R (*f)(T*, ArgsF...), std::tuple<ArgsT...> const &t, )
template<int pos, class ...Args>
class _PyObjectFunctionToNativeFunction_SetTupleValue
#include <pythonscriptinterpreter.h>
template<int pos>
class _PyObjectFunctionToNativeFunction_SetTupleValue<pos>
#include <pythonscriptinterpreter.h>

Public Static Functions

void setTupleValue(PyObject*)
template<int pos, class Arg, class ...Args>
class _PyObjectFunctionToNativeFunction_SetTupleValue<pos, Arg, Args...>
#include <pythonscriptinterpreter.h>

Public Static Functions

void setTupleValue(PyObject *tup, Arg arg, Args... args)
template<int pos, class ...Args>
class _PyObjectFunctionToNativeFunction_TupleValueSetter
#include <pythonscriptinterpreter.h>

This class is a workaround for gcc<4.9 bug 55914. It was not able to call …::setTupleValue directly from within the invokePython lambda

Public Functions

_PyObjectFunctionToNativeFunction_TupleValueSetter(Args... args)
void set(PyObject *tuple)

Private Members

std::function<void(PyObject*)> _set

Private Static Functions

void __set(Args... args, PyObject *tuple)
template<typename T, T>
struct CallNativeHelperMethodWithPyObjectArguments
#include <pythonscriptinterpreter.h>
template<typename T, typename R, typename ... Args, R(*)(T *, Args...) MF> CallNativeHelperMethodWithPyObjectArguments< R(*)(T *, Args...), MF >
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *call(PyObject *a, PyObject *b)
template<typename T, typename ... Args, void(*)(T *, Args...) MF> CallNativeHelperMethodWithPyObjectArguments< void(*)(T *, Args...), MF >
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *call(PyObject *a, PyObject *b)
template<typename T, T>
struct CallNativeMethodWithPyObjectArguments
#include <pythonscriptinterpreter.h>
template<typename T, typename R, typename ... Args, R(T::*)(Args...) const MF> *)(Args...) const, MF >
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *call(PyObject *a, PyObject *b)
template<typename T, typename R, typename ... Args, R(T::*)(Args...) MF> *)(Args...), MF >
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *call(PyObject *a, PyObject *b)
template<typename T, typename ... Args, void(T::*)(Args...) const MF> *)(Args...) const, MF >
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *call(PyObject *a, PyObject *b)
template<typename T, typename ... Args, void(T::*)(Args...) MF> *)(Args...), MF >
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *call(PyObject *a, PyObject *b)
class Converters
#include <pythonscriptinterpreter.h>

Public Static Functions

QString getStringFromPyObject(PyObject *o)
QVariant getVariantFromPyObject(PyObject *o)
int getIntFromPyObject(PyObject *o)
double getDoubleFromPyObject(PyObject *o)
qint64 getInt64FromPyObject(PyObject *o)
quint64 getUint64FromPyObject(PyObject *o)
bool getBoolFromPyObject(PyObject *o)
QByteArray getByteArrayFromPyObject(PyObject *o)
void *getPointerFromPyObject(PyObject *o)
std::shared_ptr<void> getSharedPointerFromPyObject(PyObject *o)
PyObject *getPyObjectFromString(QString v)
PyObject *getPyObjectFromVariant(QVariant v)
PyObject *getPyObjectFromInt(int v)
PyObject *getPyObjectFromDouble(double v)
PyObject *getPyObjectFromInt64(qint64 v)
PyObject *getPyObjectFromUint64(quint64 v)
PyObject *getPyObjectFromBool(bool v)
PyObject *getPyObjectFromByteArray(QByteArray v)
template<int mode, uint N>
struct FunctionBindTuple
#include <pythonscriptinterpreter.h>
template<>
struct FunctionBindTuple<0, 0>
#include <pythonscriptinterpreter.h>

Public Static Functions

template<typename R, typename T, typename ...ArgsF, typename ...ArgsT, typename ...Args>
R applyTuple(T *pObj, R (T::* f)(ArgsF...), const std::tuple<ArgsT...>&, Args... args, )
template<uint N>
struct FunctionBindTuple<0, N>
#include <pythonscriptinterpreter.h>

Public Static Functions

template<typename R, typename T, typename ...ArgsF, typename ...ArgsT, typename ...Args>
R applyTuple(T *pObj, R (T::* f)(ArgsF...), const std::tuple<ArgsT...> &t, Args... args, )
template<>
struct FunctionBindTuple<1, 0>
#include <pythonscriptinterpreter.h>

Public Static Functions

template<typename R, typename T, typename ...ArgsF, typename ...ArgsT, typename ...Args>
R applyTuple(T *pObj, R (*f)(T*, ArgsF...), const std::tuple<ArgsT...>&, Args... args, )
template<uint N>
struct FunctionBindTuple<1, N>
#include <pythonscriptinterpreter.h>

Public Static Functions

template<typename R, typename T, typename ...ArgsF, typename ...ArgsT, typename ...Args>
R applyTuple(T *pObj, R (*f)(T*, ArgsF...), const std::tuple<ArgsT...> &t, Args... args, )
template<class V>
class NativeToPyObject
#include <pythonscriptinterpreter.h>

Helps to return a Python object from a native c++ value (with reference ownership)

template<>
class NativeToPyObject<bool>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(bool v)
template<>
class NativeToPyObject<double>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(double v)
template<>
class NativeToPyObject<int>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(int v)
template<>
class NativeToPyObject<QByteArray>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(QByteArray v)
template<>
class NativeToPyObject<qint64>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(qint64 v)
template<typename V>
class NativeToPyObject<QList<V>>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(QList<V> v)
template<typename V>
class NativeToPyObject<QMap<QString, V>>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(QMap<QString, V> v)
template<>
class NativeToPyObject<QString>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(QString v)
template<>
class NativeToPyObject<quint64>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(quint64 v)
template<>
class NativeToPyObject<QVariant>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(QVariant v)
template<class V> shared_ptr< const V > >
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(std::shared_ptr<const V> v)
template<class V> shared_ptr< V > >
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(std::shared_ptr<V> v)
template<class V>
class NativeToPyObject<V*>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(V *v)
template<class R, class ...Args>
class PyObjectFunctionToNativeFunction
#include <pythonscriptinterpreter.h>

Public Static Functions

std::function<R(Args...)> toNativeFunction(PyObject *self, PyObject *fct)
template<class ...Args>
class PyObjectFunctionToNativeFunction<void, Args...>
#include <pythonscriptinterpreter.h>

Public Static Functions

std::function<void(Args...)> toNativeFunction(PyObject *self, PyObject *fct)
template<class V>
class PyObjectToNative
#include <pythonscriptinterpreter.h>

Helps to return a c++ value from a Python object (borrows the reference)

template<>
class PyObjectToNative<bool>
#include <pythonscriptinterpreter.h>

Public Static Functions

bool toNative(PyObject*, PyObject *o)
template<>
class PyObjectToNative<double>
#include <pythonscriptinterpreter.h>

Public Static Functions

double toNative(PyObject*, PyObject *o)
template<>
class PyObjectToNative<int>
#include <pythonscriptinterpreter.h>

Public Static Functions

int toNative(PyObject*, PyObject *o)
template<>
class PyObjectToNative<QByteArray>
#include <pythonscriptinterpreter.h>

Public Static Functions

QByteArray toNative(PyObject*, PyObject *o)
template<>
class PyObjectToNative<qint64>
#include <pythonscriptinterpreter.h>

Public Static Functions

qint64 toNative(PyObject*, PyObject *o)
template<class V>
class PyObjectToNative<QList<V>>
#include <pythonscriptinterpreter.h>

Public Static Functions

QList<V> toNative(PyObject *a, PyObject *o)
template<>
class PyObjectToNative<QString>
#include <pythonscriptinterpreter.h>

Public Static Functions

QString toNative(PyObject*, PyObject *o)
template<>
class PyObjectToNative<quint64>
#include <pythonscriptinterpreter.h>

Public Static Functions

qint64 toNative(PyObject*, PyObject *o)
template<>
class PyObjectToNative<QVariant>
#include <pythonscriptinterpreter.h>

Public Static Functions

QVariant toNative(PyObject*, PyObject *o)
template<class V, class ... Args> function< V(Args...)> >
#include <pythonscriptinterpreter.h>

Public Static Functions

std::function<V(Args...)> toNative(PyObject *self, PyObject *io)
template<class V> shared_ptr< V > >
#include <pythonscriptinterpreter.h>

Public Static Functions

std::shared_ptr<V> toNative(PyObject*, PyObject *o)
template<class V>
class PyObjectToNative<StringMap<V>>
#include <pythonscriptinterpreter.h>

Public Static Functions

StringMap<V> toNative(PyObject *a, PyObject *o)
template<class V>
class PyObjectToNative<V*>
#include <pythonscriptinterpreter.h>

Public Static Functions

V *toNative(PyObject*, PyObject *o)
template<int pos, typename ...Args>
struct PyObjectTupleToNativeTuple
#include <pythonscriptinterpreter.h>
template<int pos>
struct PyObjectTupleToNativeTuple<pos>
#include <pythonscriptinterpreter.h>

Public Static Functions

std::tuple toNativeTuple(PyObject*, PyObject*)
template<int pos, class T, class ...Args>
struct PyObjectTupleToNativeTuple<pos, T, Args...>
#include <pythonscriptinterpreter.h>

Public Static Functions

std::tuple<T, Args...> toNativeTuple(PyObject *a, PyObject *b)
template<typename D, typename T, T>
struct ScriptedMethodProxy
#include <pythonscriptinterpreter.h>
template<typename T, typename R, typename ... Args, std::function< R(Args...)> T::* MF> *, MF >
#include <pythonscriptinterpreter.h>

Public Static Functions

void setImplementation(T *inst, std::function<R(Args...)> vfct)
PyObject *pyObjectFunctionSetImplementation(PyObject *a, PyObject *b)
namespace search

Infrastructure for searches in the filesystem.

See sh::search::SearchManager for more.

class Search : public QObject, public std::enable_shared_from_this<Search>
#include <search.h>

A search object represents one search request the user made.

Public Functions

~Search()
std::shared_ptr<const sh::filesystem::Eurl> eurl()

Returns the eurl containg the search configuration.

std::shared_ptr<sh::filesystem::FilesystemNode> searchnode()

Returns the root node of the search (the one named like ‘Search …’).

Search(std::shared_ptr<const filesystem::Eurl> eurl, std::shared_ptr<sh::filesystem::FilesystemNode> searchnode)

See sh::search::SearchManager::requestSearch.

void search()

Start the searching.

bool isSearching()

Returns if the search is currently in progress.

Signals

void isSearchingChanged()

Triggers when Search::isSearching changes.

Private Functions

void search(std::shared_ptr<const filesystem::Eurl> eurl, QString relpath)
void insertFileItem(std::shared_ptr<const sh::filesystem::Eurl> item, QString relpath, sh::filesystem::FilesystemNodeType ftype)
std::shared_ptr<sh::filesystem::FilesystemNode> getDirItem(std::shared_ptr<const sh::filesystem::Eurl> item)

Private Members

std::shared_ptr<const sh::filesystem::Eurl> _eurl
std::shared_ptr<sh::filesystem::FilesystemNode> _searchnode
sh::search::SearchConfiguration *_config
QHash<std::shared_ptr<const sh::filesystem::Eurl>, std::shared_ptr<sh::filesystem::FilesystemNode>> _dirs
QMutex _isSearchingMutex
bool _isSearching = false
bool _isSearchAgain = false
class SearchConfiguration
#include <searchconfiguration.h>

A search configuration.

Search configurations contain a list of search criteria and some auxiliary fields. Each search configuration describes what and how a user wants to search (just not where).

Public Functions

SearchConfiguration()
QString serialize()

Serialize this search configuration to a string. See also SearchConfiguration::deserialize.

Public Members

QList<std::shared_ptr<sh::search::SearchCriterion>> criteria
bool showAsTree = false

Public Static Functions

SearchConfiguration *deserialize(QString s)

Deserialize a search configuration from a string. See also SearchConfiguration::serialize.

class SearchCriterion
#include <searchcriterion.h>

Abstract base class for a search criterion.

Each search criterion implements how a user can filter his files in a search.

Register an implementation, e.g. with ‘REGISTER_CRITERION_FACTORY’ of “search/searchcriterionfactoryfromfunction.h”.

Subclassed by sh::search::criteria::AbstractActionDrivenSearchCriterion, sh::search::criteria::AbstractStringSearchCriterion, sh::search::criteria::ExtendedAttributeSearchCriterion, sh::search::criteria::MtimeSearchCriterion

Public Functions

SearchCriterion(std::shared_ptr<sh::search::SearchCriterionFactory> factory)
~SearchCriterion()
QString serialize()

Serializes this criterion to a string. See also SearchCriterion::deserialize.

bool match(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Checks if a given file (by eurl) matches this criterion. .

QString valuedescription() = 0

Returns a human readable text describing the current criterion shortly and precisely. .

std::shared_ptr<sh::search::SearchCriterionFactory> factory()

Returns the factory this criterion has created (provides some more metadata).

Public Static Functions

std::shared_ptr<sh::search::SearchCriterion> deserialize(QString s)

Deserializes this criterion from a string. See also SearchCriterion::serialize.

class SearchCriterionFactory : public std::enable_shared_from_this<SearchCriterionFactory>
#include <searchcriterionfactory.h>

Abstract base class for a search criterion factory, which constructs some sh::search::SearchCriterion instances.

It also provides some control methods and metadata (which is possible since there is a separate factory for each criterion class).

Note: Though possible in some exotic situations, one should not override this class. Override and register sh::search::SearchCriterion instead!

Subclassed by sh::scripting::api::ApiSearchCriterionFactory, sh::search::SearchCriterionFactoryFromFunction

Public Functions

SearchCriterionFactory()
QString key() = 0

Returns the string key for the associated search criterion class. .

QString description() = 0

Returns the description string for the associated search criterion class. .

void editor(std::shared_ptr<sh::search::SearchCriterion> c, sh::ui::SearchPanelConfiguration *panelcfg) = 0

Builds the search config ui in a search panel.

Takes the data from c and populates panelcfg with it.

void editorupdateconfig(sh::ui::SearchPanelConfiguration *panelcfg, std::shared_ptr<sh::search::SearchCriterion> c) = 0

Updates own data with the content from the search config ui in a search panel.

Takes the data from panelcfg and updates c with it.

std::shared_ptr<sh::search::SearchCriterion> construct() = 0

Constructs an instance of the associated search criterion class. .

bool isVisibleFor(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::FilesystemNode> node)

Checks if the associated search criterion class should be offered to the user for a given node. .

~SearchCriterionFactory()
class SearchCriterionFactoryFromFunction : public sh::search::SearchCriterionFactory
#include <searchcriterionfactoryfromfunction.h>

A search criterion factory implementation which uses some additional static methods in the sh::search::SearchCriterion subclasses for control.

This is the default search criterion factory. It is typically used indirectly by the ‘REGISTER_CRITERION_FACTORY’ macro from here.

Public Functions

SearchCriterionFactoryFromFunction(QString key, std::function<QString()> descriptionfctstd::function<void(std::shared_ptr<sh::search::SearchCriterion>, sh::ui::SearchPanelConfiguration*)> editorfct, std::function<void(sh::ui::SearchPanelConfiguration*, std::shared_ptr<sh::search::SearchCriterion>)> editorupdateconfigfct, std::function<std::shared_ptr<sh::search::SearchCriterion>(std::shared_ptr<sh::search::SearchCriterionFactory>)> constructfct)
QString key()

Returns the string key for the associated search criterion class. .

QString description()

Returns the description string for the associated search criterion class. .

void editor(std::shared_ptr<sh::search::SearchCriterion> c, sh::ui::SearchPanelConfiguration *panelcfg)

Builds the search config ui in a search panel.

Takes the data from c and populates panelcfg with it.

void editorupdateconfig(sh::ui::SearchPanelConfiguration *panelcfg, std::shared_ptr<sh::search::SearchCriterion> c)

Updates own data with the content from the search config ui in a search panel.

Takes the data from panelcfg and updates c with it.

std::shared_ptr<SearchCriterion> construct()

Constructs an instance of the associated search criterion class. .

bool isVisibleFor(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::FilesystemNode> node)

Checks if the associated search criterion class should be offered to the user for a given node. .

Private Members

QString _key
std::function<QString()> _descriptionfct
std::function<void(std::shared_ptr<sh::search::SearchCriterion>, sh::ui::SearchPanelConfiguration*)> _editorfct
std::function<void(sh::ui::SearchPanelConfiguration*, std::shared_ptr<sh::search::SearchCriterion>)> _editorupdateconfigfct
std::function< std::shared_ptr< sh::search::SearchCriterion >std::shared_ptr< sh::search::SearchCriterionFactory >)> _constructfct
class SearchFilesystemHandler : public sh::filesystem::FilesystemHandler, public sh::base::Singleton
#include <searchfilesystemhandler.h>

A filesystem handler for presenting filesystem search results.

Public Functions

void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list) override
sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time) override
QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target) override
bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer) override
bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) override
bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src) override
void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath) override
QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) override
void customizeUi(std::shared_ptr<sh::filesystem::FilesystemNode> node, bool *showSearchPanel) override
void configureItems(sh::filesystem::Operation *op, QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) override

Configure newly created nodes (e.g. setting another icon or changing the display name).

void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list) = 0

Determine a list of subelements in a certain directory.

sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine if a file is regular, or a dir, or a link, …

qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the size of a file.

QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the mtime of a file.

void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time) = 0

Set the mtime of a file.

QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine mime type of a file.

QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Resolve a link.

QList<QString> listExtendedAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Fetches the list of available extended attributes for an entry.

quint64 getExtendedAttributeSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the site of value for one extended attribute for an entry.

QByteArray getExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the value for one extended attribute for an entry.

void setExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QByteArray value)

Sets the value for one extended attribute for an entry.

void removeExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Removes one extended attributes for an entry.

QMap<QString, QString> getCustomAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Returns the custom attributes for an entry.

In contrast to extended attributes, the custom attributes are not directly stored in the filesystem this way, but handle implementation specific aspects (like permissions).

void setCustomAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QString value)

Sets the value for one custom attribute for an entry.

See also getCustomAttributes.

bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to get the content of a certain file.

std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Get the content of a file.

bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create subdirectories in a certain directory.

void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Create a directory.

bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create a link in a certain directory.

void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target) = 0

Create a link.

bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create files in a certain directory.

void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer) = 0

Creates a file with some content.

It may use handlertransfer for some better integration, like cancel support and progress monitoring.

bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to delete a certain file/directory/link/….

void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Delete a file/directory/link/…

void deleteDirectoryIfEmpty(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Deletes a directory only of it is empty.

bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src) = 0

Returns if it is allowed to rename a certain file, directory, link, … (see renameItem).

void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath) = 0

Renames an item to another path.

It can be a simple filename change or also changes in the deeper path segments.

QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) = 0

Returns a list of actions (see former example) for showing for certain files.

bool requiresResolvedLinks()

Returns if this handler requires to be used by the engine with resolved links.

void viewEnteredDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view entered some directory (e.g. for enabling watchers). See also viewLeftDirectory.

void viewLeftDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view left some directory. See also viewEnteredDirectory.

bool isWellKnownScheme()

Returns if the scheme for this handler is a well known one (which external programs typically would understand).

void search(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>, QList<std::shared_ptr<sh::search::SearchCriterion>>, sh::filesystem::FilesystemNodeType ftype)> addfile, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>)> visitdir, QList<std::shared_ptr<sh::search::SearchCriterion>> criteria, )

Helps searching for files.

Override this method with a behavior identical to the default, if a specialized implementation can be much faster than the default one.

void customizeUi(std::shared_ptr<sh::filesystem::FilesystemNode> node, bool *showSearchPanel)

Creates a custom gui, which becomes part of the fileview.

sh::filesystem::FilesystemModel *model()

A convenience shortcut to the sh::filesystem::FilesystemModel (a singleton).

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

SearchFilesystemHandler()
class SearchManager : public QObject, public sh::base::Singleton
#include <searchmanager.h>

Manager for searches in the filesystem.

Public Functions

std::shared_ptr<sh::search::Search> requestSearch(std::shared_ptr<const sh::filesystem::Eurl> eurl, QString searchconfig, std::shared_ptr<sh::filesystem::FilesystemNode> searchrootnode)

Requests a search.

void removeSearch(std::shared_ptr<sh::search::Search> search)

Removes a search.

std::shared_ptr<sh::search::Search> findSearch(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Returns the Search instance for an eurl for a search root node.

void addFactory(int index, std::shared_ptr<SearchCriterionFactory> f)

Adds a search criterion factory.

QList<std::shared_ptr<SearchCriterionFactory>> factories()

Returns the sorted list of search criterion factories.

~SearchManager()
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

const int REGISTER_SEARCHCRITERION_INDEX_CORE = 1000000

Base value for display indexes of core (i.e. very important) search criteria.

Used in SearchManager::addFactory.

const int REGISTER_SEARCHCRITERION_INDEX_NORMAL = 2000000

Base value for display indexes of search criteria with normal importance.

Used in SearchManager::addFactory.

const int REGISTER_SEARCHCRITERION_INDEX_EXOTIC = 3000000

Base value for display indexes of exotic search criteria.

Used in SearchManager::addFactory.

Private Functions

SearchManager()

Private Members

QList<std::shared_ptr<sh::search::Search>> _searches
QList<std::weak_ptr<sh::search::Search>> _weak_searches
QMap<int, std::shared_ptr<SearchCriterionFactory>> _factories
namespace criteria

Implementations of search criteria.

Subclasses of sh::search::SearchCriterion.

class AbstractActionDrivenSearchCriterion : public sh::search::SearchCriterion
#include <abstractactiondrivensearchcriterion.h>

Abstract search criterion filtering by something which is configured in a wizard-like way by an action execution.

This provides an easy yet powerful programming interface, e.g. for usage in scripting.

Subclassed by sh::scripting::api::ApiSearchCriterion

Public Functions

AbstractActionDrivenSearchCriterion(std::shared_ptr<sh::search::SearchCriterionFactory> factory)
bool match(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Checks if a given file (by eurl) matches this criterion. .

bool match2(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0
QString valuedescription()

Returns a human readable text describing the current criterion shortly and precisely. .

QString serialize()

Serializes this criterion to a string. See also SearchCriterion::deserialize.

std::shared_ptr<sh::search::SearchCriterionFactory> factory()

Returns the factory this criterion has created (provides some more metadata).

Public Members

QStringList searchspec

Public Static Functions

void _createEditor(std::shared_ptr<sh::search::SearchCriterion> cfg, sh::ui::SearchPanelConfiguration *panelcfg)
void _editorUpdateConfiguration(sh::ui::SearchPanelConfiguration *panelcfg, std::shared_ptr<sh::search::SearchCriterion> c)
std::shared_ptr<sh::search::SearchCriterion> deserialize(QString s)

Deserializes this criterion from a string. See also SearchCriterion::serialize.

Friends

friend class ActionAbstractActionDrivenSearchCriterionConfigure
class AbstractStringSearchCriterion : public sh::search::SearchCriterion
#include <abstractstringsearchcriterion.h>

Abstract search criterion filtering by some string value (providing different modes like exact, fuzzy, regexp, …).

Subclassed by sh::search::criteria::FileContentSearchCriterion, sh::search::criteria::FilenameSearchCriterion

Public Types

enum Mode

Values:

enumerator Simple
enumerator Exact
enumerator RegExp
enumerator Fuzzy

Public Functions

AbstractStringSearchCriterion(std::shared_ptr<sh::search::SearchCriterionFactory> factory)
bool match(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Checks if a given file (by eurl) matches this criterion. .

QString valuedescription()

Returns a human readable text describing the current criterion shortly and precisely. .

QString serialize()

Serializes this criterion to a string. See also SearchCriterion::deserialize.

std::shared_ptr<sh::search::SearchCriterionFactory> factory()

Returns the factory this criterion has created (provides some more metadata).

Public Members

QString string
Mode mode = Mode::Simple

Public Static Functions

void _createEditor(std::shared_ptr<sh::search::SearchCriterion> cfg, ui::SearchPanelConfiguration *panelcfg)
void _editorUpdateConfiguration(sh::ui::SearchPanelConfiguration *panelcfg, std::shared_ptr<sh::search::SearchCriterion> c)
int levenshteinSubstringDistance(QString needle, QString haystack)
double relativeLevenshteinPartsSubstringDistance(QString needle, QString haystack)
std::shared_ptr<sh::search::SearchCriterion> deserialize(QString s)

Deserializes this criterion from a string. See also SearchCriterion::serialize.

Public Static Attributes

const QStringList ModeCodes
class ActionAbstractActionDrivenSearchCriterionConfigure : public sh::actions::ActionActionItem
#include <abstractactiondrivensearchcriterion.h>

Public Functions

ActionAbstractActionDrivenSearchCriterionConfigure(std::shared_ptr<AbstractActionDrivenSearchCriterion> cfg, QMutex *mutex)
void action(sh::actions::ActionExecutionInfo *info)

The action implementation, i.e. what the actions should actually do.

void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

Private Members

std::shared_ptr<AbstractActionDrivenSearchCriterion> _cfg
QMutex *_mutex
class ExtendedAttributeSearchCriterion : public sh::search::SearchCriterion
#include <extendedattributesearchcriterion.h>

Search criterion filtering by extended attributes.

Public Types

enum Mode

Values:

enumerator None
enumerator Simple
enumerator RegExp
enumerator Fuzzy

Public Functions

ExtendedAttributeSearchCriterion(std::shared_ptr<sh::search::SearchCriterionFactory> factory)
bool match(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Checks if a given file (by eurl) matches this criterion. .

QString valuedescription()

Returns a human readable text describing the current criterion shortly and precisely. .

QString serialize()

Serializes this criterion to a string. See also SearchCriterion::deserialize.

std::shared_ptr<sh::search::SearchCriterionFactory> factory()

Returns the factory this criterion has created (provides some more metadata).

Public Members

Mode keymode = Mode::None
Mode valuemode = Mode::Simple
QString key
QString value

Public Static Functions

void createEditor(std::shared_ptr<sh::search::SearchCriterion> cfg, sh::ui::SearchPanelConfiguration *panelcfg)
void editorUpdateConfiguration(sh::ui::SearchPanelConfiguration *panelcfg, std::shared_ptr<sh::search::SearchCriterion> c)
void doInitialize()
void doShutdown()
std::shared_ptr<sh::search::SearchCriterion> deserialize(QString s)

Deserializes this criterion from a string. See also SearchCriterion::serialize.

Public Static Attributes

const QStringList ModeCodes
class FileContentSearchCriterion : public sh::search::criteria::AbstractStringSearchCriterion
#include <filecontentsearchcriterion.h>

Search criterion filtering by file contents.

Public Types

enum Mode

Values:

enumerator Simple
enumerator Exact
enumerator RegExp
enumerator Fuzzy

Public Functions

FileContentSearchCriterion(std::shared_ptr<sh::search::SearchCriterionFactory> factory)
bool match(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Checks if a given file (by eurl) matches this criterion. .

QString valuedescription()

Returns a human readable text describing the current criterion shortly and precisely. .

QString serialize()

Serializes this criterion to a string. See also SearchCriterion::deserialize.

std::shared_ptr<sh::search::SearchCriterionFactory> factory()

Returns the factory this criterion has created (provides some more metadata).

Public Members

QString string
Mode mode = Mode::Simple

Public Static Functions

void createEditor(std::shared_ptr<sh::search::SearchCriterion> cfg, sh::ui::SearchPanelConfiguration *panelcfg)
void editorUpdateConfiguration(sh::ui::SearchPanelConfiguration *panelcfg, std::shared_ptr<sh::search::SearchCriterion> c)
void doInitialize()
void doShutdown()
void _createEditor(std::shared_ptr<sh::search::SearchCriterion> cfg, ui::SearchPanelConfiguration *panelcfg)
void _editorUpdateConfiguration(sh::ui::SearchPanelConfiguration *panelcfg, std::shared_ptr<sh::search::SearchCriterion> c)
int levenshteinSubstringDistance(QString needle, QString haystack)
double relativeLevenshteinPartsSubstringDistance(QString needle, QString haystack)
std::shared_ptr<sh::search::SearchCriterion> deserialize(QString s)

Deserializes this criterion from a string. See also SearchCriterion::serialize.

Public Static Attributes

const QStringList ModeCodes
class FilenameSearchCriterion : public sh::search::criteria::AbstractStringSearchCriterion
#include <filenamesearchcriterion.h>

Search criterion filtering by file names.

Public Types

enum Mode

Values:

enumerator Simple
enumerator Exact
enumerator RegExp
enumerator Fuzzy

Public Functions

FilenameSearchCriterion(std::shared_ptr<sh::search::SearchCriterionFactory> factory)
bool match(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Checks if a given file (by eurl) matches this criterion. .

QString valuedescription()

Returns a human readable text describing the current criterion shortly and precisely. .

QString serialize()

Serializes this criterion to a string. See also SearchCriterion::deserialize.

std::shared_ptr<sh::search::SearchCriterionFactory> factory()

Returns the factory this criterion has created (provides some more metadata).

Public Members

QString string
Mode mode = Mode::Simple

Public Static Functions

void createEditor(std::shared_ptr<sh::search::SearchCriterion> cfg, sh::ui::SearchPanelConfiguration *panelcfg)
void editorUpdateConfiguration(sh::ui::SearchPanelConfiguration *panelcfg, std::shared_ptr<sh::search::SearchCriterion> c)
void doInitialize()
void doShutdown()
void _createEditor(std::shared_ptr<sh::search::SearchCriterion> cfg, ui::SearchPanelConfiguration *panelcfg)
void _editorUpdateConfiguration(sh::ui::SearchPanelConfiguration *panelcfg, std::shared_ptr<sh::search::SearchCriterion> c)
int levenshteinSubstringDistance(QString needle, QString haystack)
double relativeLevenshteinPartsSubstringDistance(QString needle, QString haystack)
std::shared_ptr<sh::search::SearchCriterion> deserialize(QString s)

Deserializes this criterion from a string. See also SearchCriterion::serialize.

Public Static Attributes

const QStringList ModeCodes
class MtimeSearchCriterion : public sh::search::SearchCriterion
#include <mtimesearchcriterion.h>

Search criterion filtering by file modification times.

Public Functions

MtimeSearchCriterion(std::shared_ptr<sh::search::SearchCriterionFactory> factory)
bool match(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Checks if a given file (by eurl) matches this criterion. .

QString valuedescription()

Returns a human readable text describing the current criterion shortly and precisely. .

QString serialize()

Serializes this criterion to a string. See also SearchCriterion::deserialize.

std::shared_ptr<sh::search::SearchCriterionFactory> factory()

Returns the factory this criterion has created (provides some more metadata).

Public Members

QDateTime from
QDateTime to

Public Static Functions

void createEditor(std::shared_ptr<sh::search::SearchCriterion> cfg, sh::ui::SearchPanelConfiguration *panelcfg)
void editorUpdateConfiguration(sh::ui::SearchPanelConfiguration *panelcfg, std::shared_ptr<sh::search::SearchCriterion> c)
void doInitialize()
void doShutdown()
std::shared_ptr<sh::search::SearchCriterion> deserialize(QString s)

Deserializes this criterion from a string. See also SearchCriterion::serialize.

namespace settings

Infrastructure for settings, so everything you see in ‘Manage saved settings’.

See the abstract base class sh::settings::Setting and sh::settings::SettingsManager for more.

Enums

enum SettingGroup

Groups of settings.

A choice here does not make a logical impact. It is merely a matter of graphical presentation.

Values:

enumerator GLOBAL = 1
enumerator GUI = 2
enumerator FILEHANDLING = 3
enumerator DATAVIEW = 4
enumerator BEHAVIOR = 5
enumerator SPECIAL = 6
class ProfileNode
#include <profilenode.h>

One entry in a Shallot settings profile, so one item as selectable in the ‘Manage settings’ dialog.

Public Functions

ProfileNode()

Constructed only by the infrastructure and made available otherwise.

QString nodeId()

An identifier name.

void setNodeId(QString nodeId)

Sets the identifier name.

std::shared_ptr<const filesystem::Eurl> eurl()

The eurl of the directory, or 0 for global profile nodes.

void setEurl(std::shared_ptr<const filesystem::Eurl> eurl)

Sets the eurl.

QString profilename()

The profile name.

void setProfilename(QString profilename)

Sets the profile name.

QStringList inheritsFrom()

List of profile names from which this node inherits.

void setInheritsFrom(QStringList profilenames)

Sets list of profile names from which this node inherits.

bool withSubfolders()

If this node also applies recursively on subfolders.

void setWithSubfolders(bool v)

Sets of this node also applies recursively on subfolders.

void setSetting(QString name, QString value, int onlyInFileview = -1)

Stores a value for a setting for applying it later.

QList<QString> getSettingNames()

List of settings names which are set in this node.

QString getSettingValue(QString name)

Gets the stored value of a setting by setting name.

int getSettingOnlyInFileviewIndex(QString name)

Gets if a setting applies to a certain fileview or to the entire window.

Private Members

QMap<QString, QString> _values
QMap<QString, int> _valuesOnlyInFileviewIndex
std::shared_ptr<const sh::filesystem::Eurl> _eurl
QString _profilename
QStringList _inheritsFrom
bool _withSubfolders
QString _nodeId
class Setting
#include <setting.h>

Abstract base class for a Shallot setting.

Those have the greatest flexibility. They have to be stored manually by the user with many options. See Shallot documentation for details.

Use sh::settings::SettingsRegistration for registering an implementation.

Subclassed by sh::scripting::api::ApiSetting, sh::settings::common::FileDetailsPanelVisible, sh::settings::common::FileViewIconListThumbDimension, sh::settings::common::FileViewPath, sh::settings::common::FileViewViewmode, sh::settings::common::JumpbarMode, sh::settings::common::NumberOfFilePanels, sh::settings::common::ShowHiddenFiles, sh::settings::common::ShowTree, sh::settings::common::SizeFormattingMode, sh::settings::common::StickyTreeview, sh::settings::common::WindowTitle

Public Functions

Setting()

Is (for subclasses) intended to be directly constructed from everywhere or by registering a factory somewhere.

~Setting()
QString name() = 0

Gets the internal name.

QString description() = 0

Gets the description text.

SettingGroup group() = 0

Gets the group;.

bool isAdvancedSetting() = 0

Is this an advanced setting?

void setValue(sh::ui::FileView*, QString)

Called from Shallot core when the value was set (for a per-fileview setting).

void setValue(QString)

Called from Shallot core when the value was set (for a not-per-fileview setting).

bool isGlobal() = 0

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview() = 0

Does this setting apply for each fileview individually or for the complete main window?

QString getValue(sh::ui::FileView *filelist) = 0

Get the currently set value.

QString valueDescription(QString value)

Gets a human readable description text for a value.

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class SettingsManager : public QObject, public sh::base::Singleton
#include <settingsmanager.h>

Manager for Shallot settings.

This is the more flexible way of shallot customization. It includes everything you see in the ‘Manage saved settings’ or ‘Save settings’.

See sh::settings::Setting for more.

Public Functions

void applyPerEurlSettingsToFileView(sh::ui::FileView *list)

Applies all stored settings, which are per-eurl to a fileview.

void applyGlobalSettingsToFileView(sh::ui::FileView *list)

Applies all stored settings, which are global to a fileview.

void applyPerEurlSettingsToMainWindow()

Applies all stored settings, which are per-eurl to main window.

void applyGlobalSettingsToMainWindow()

Applies all stored settings, which are global to a main window.

QList<sh::settings::ProfileNode*> getNodesForProfile(QString profile)

Returns a list of all stored settings (as ProfileNodes) for a given profile.

sh::settings::ProfileNode *getNodeByNodeId(QString nodeId)

Searches and returns a ProfileNode by id.

std::shared_ptr<sh::settings::Setting> getSettingByName(QString name)

Searches and returns a Setting by name.

QList<std::shared_ptr<sh::settings::Setting>> getAllSettings()

Returns a list of all available settings, primarily sorted by group.

QStringList getProfileList()

Returns a list of all existing profiles.

void removeProfile(QString profile)

Removes a profile (including all ProfileNodes inside it).

void removeNode(QString nodeId)

Removes a ProfileNode by id.

void storeProfile(std::shared_ptr<const sh::filesystem::Eurl> eurl, QString profilename, QMap<QString, QString> values, QMap<QString, int> onlyinfileviewindex, bool withSubfolders, QStringList inheritFrom)

Stores one setting into a profile.

~SettingsManager()
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 profilesChanged()

Triggered when the list of profiles or the nodes inside it change.

Can also be triggered when nothing really changed!

Private Functions

void applyToFileView(sh::ui::FileView *list, QMap<QString, QString> settings)

Applies some settings (as string tuples) to a fileview.

void applyToMainWindow(QMap<QString, QString> settings)

Applies some settings (as string tuples) to main window.

QMap<QString, QString> _getSettings(std::shared_ptr<const sh::filesystem::Eurl> eurl, QString profilename, int fileviewindex, bool directNode = true)

Computes all effective settings (including inheritance and sub-directories) for a given situation (global or eurl-bound; fileview- or mainwindow-bound) and returns it as string tuples.

Parameters
  • eurl: The directory to consider as current (or nullptr for global settings).

  • profilename: The current profile.

  • fileviewindex: The fileview index (or -1 for mainwindow-bound settings).

  • directNode: If the given directory is to be considered as the real current directory (not e.g. a parent).

QList<_SettingsFinderStructure> _getSettings_flat(std::shared_ptr<const sh::filesystem::Eurl> eurl, QString profilename)

Used internally by _getSettings().

void invalidateCache()

Invalidates the _getSettings cache.

void readStoredProfiles()

Reads all profiles (including all setting nodes) from filesystem.

SettingsManager()

Private Members

QMap<QString, QMap<QString, QString>> _getSettings_cache
QMap<QString, std::shared_ptr<sh::settings::Setting>> _settings
QMap<std::shared_ptr<const sh::filesystem::Eurl>, QMap<QString, QList<sh::settings::ProfileNode*>>> _profileNodes
QMap<QString, sh::settings::ProfileNode*> _profileNodesById
QList<QString> _profileNames

Friends

friend class sh::settings::SettingsRegistration
class _MyHandler : public QXmlDefaultHandler

Used internally for reading profile node XMLs.

Public Functions

_MyHandler(sh::settings::ProfileNode *node, QString filename)
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)

Private Functions

void throwError()

Private Members

bool _stateStarted = true
bool _stateInProfile = false
sh::settings::ProfileNode *_node
QString _filename
class _SettingsFinderStructure

Used internally by _getSettings().

Public Functions

_SettingsFinderStructure(QMap<QString, QString> settings, QMap<QString, int> onlyinfileviewindexes, QStringList inheritFrom, bool withSubfolders)
_SettingsFinderStructure()

Public Members

QMap<QString, QString> _settings
QMap<QString, int> _onlyinfileviewindexes
QStringList _inheritFrom
bool _withSubfolders
int _onlyFileviewIndex
class SettingsRegistration
#include <settingsregistration.h>

Used for registering a setting instance.

Constructing a SettingsRegistration automatically registers a sh::settings::Setting, deleting a one automatically unregisters it.

Public Functions

SettingsRegistration(std::shared_ptr<sh::settings::Setting> setting)

Is intended to be directly constructed from everywhere.

~SettingsRegistration()
std::shared_ptr<sh::settings::Setting> setting()

Private Members

std::shared_ptr<sh::settings::Setting> _setting
namespace common

Implementations of settings.

Subclasses of sh::settings::Setting (and possibly some auxiliary stuff). Everything here could be listed in the ‘Save settings’ dialog.

class FileDetailsPanelVisible : public sh::settings::Setting
#include <filedetailspanelvisible.h>

Public Functions

FileDetailsPanelVisible()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(QString value)

Called from Shallot core when the value was set (for a not-per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

void setValue(sh::ui::FileView*, QString)

Called from Shallot core when the value was set (for a per-fileview setting).

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class FileViewIconListThumbDimension : public sh::settings::Setting
#include <fileviewiconlistthumbdimension.h>

Public Functions

FileViewIconListThumbDimension()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(sh::ui::FileView *filelist, QString value)

Called from Shallot core when the value was set (for a per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

void setValue(QString)

Called from Shallot core when the value was set (for a not-per-fileview setting).

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class FileViewPath : public sh::settings::Setting
#include <fileviewpath.h>

Public Functions

FileViewPath()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(sh::ui::FileView *fileview, QString value)

Called from Shallot core when the value was set (for a per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

void setValue(QString)

Called from Shallot core when the value was set (for a not-per-fileview setting).

QString valueDescription(QString value)

Gets a human readable description text for a value.

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class FileViewViewmode : public sh::settings::Setting
#include <fileviewviewmode.h>

Public Functions

FileViewViewmode()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(sh::ui::FileView *fileview, QString value)

Called from Shallot core when the value was set (for a per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

void setValue(QString)

Called from Shallot core when the value was set (for a not-per-fileview setting).

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class JumpbarMode : public sh::settings::Setting
#include <jumpbarmode.h>

Public Functions

JumpbarMode()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(QString value)

Called from Shallot core when the value was set (for a not-per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

void setValue(sh::ui::FileView*, QString)

Called from Shallot core when the value was set (for a per-fileview setting).

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class NumberOfFilePanels : public sh::settings::Setting
#include <numberoffilepanels.h>

Public Functions

NumberOfFilePanels()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(QString value)

Called from Shallot core when the value was set (for a not-per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

void setValue(sh::ui::FileView*, QString)

Called from Shallot core when the value was set (for a per-fileview setting).

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class ShowHiddenFiles : public sh::settings::Setting
#include <showhiddenfiles.h>

Public Functions

ShowHiddenFiles()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(sh::ui::FileView *filelist, QString value)

Called from Shallot core when the value was set (for a per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

void setValue(QString)

Called from Shallot core when the value was set (for a not-per-fileview setting).

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class ShowTree : public sh::settings::Setting
#include <showtree.h>

Public Functions

ShowTree()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(QString value)

Called from Shallot core when the value was set (for a not-per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

void setValue(sh::ui::FileView*, QString)

Called from Shallot core when the value was set (for a per-fileview setting).

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class SizeFormattingMode : public sh::settings::Setting
#include <sizeformattingmode.h>

Public Functions

SizeFormattingMode()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(sh::ui::FileView *filelist, QString value)

Called from Shallot core when the value was set (for a per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

void setValue(QString)

Called from Shallot core when the value was set (for a not-per-fileview setting).

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class StickyTreeview : public sh::settings::Setting
#include <stickytreeview.h>

Public Functions

StickyTreeview()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(QString value)

Called from Shallot core when the value was set (for a not-per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

void setValue(sh::ui::FileView*, QString)

Called from Shallot core when the value was set (for a per-fileview setting).

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class WindowTitle : public sh::settings::Setting
#include <windowtitle.h>

Public Functions

WindowTitle()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(QString value)

Called from Shallot core when the value was set (for a not-per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

void setValue(sh::ui::FileView*, QString)

Called from Shallot core when the value was set (for a per-fileview setting).

QString valueDescription(QString value)

Gets a human readable description text for a value.

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

namespace 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>

Public Functions

Increment(AtomicCounter *ac)
~Increment()

Private Members

AtomicCounter *_ac

Friends

friend class 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).

class Bookmark
#include <bookmarkmanager.h>

A bookmark.

Public Functions

Bookmark(QString id, QStringList folder, QString label, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString tags)

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.

QString tags()

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
QString _tags
class BookmarkManager : public QObject, public sh::base::Singleton
#include <bookmarkmanager.h>

The bookmark manager.

Use it for getting or modifying bookmarks.

Public Functions

QList<std::shared_ptr<sh::tools::Bookmark>> getBookmarks()

Returns a list of all stored bookmarks.

bool hasBookmarks()

Checks if any bookmarks exist.

QString addBookmark(QList<QString> folder, QString label, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString tags = QString())

Adds a new bookmark.

Return

The id of the new bookmark.

void removeBookmark(QString id)

Removes a bookmarks.

void changeBookmark(QString id, QString label, std::shared_ptr<const sh::filesystem::Eurl> eurl)

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 _changeBookmark(QString id, std::function<QString(std::shared_ptr<Bookmark>)> label, std::function<std::shared_ptr<const sh::filesystem::Eurl>(std::shared_ptr<Bookmark>)> eurl, std::function<QList<QString>(std::shared_ptr<Bookmark>)> folder, std::function<QString(std::shared_ptr<Bookmark>)> tags)
void readBookmarks()
void writeBookmarks()

Private Members

std::shared_ptr<sh::configuration::ConfigurationValue> cfgvalBookmarks
QList<std::shared_ptr<Bookmark>> _bookmarks
QMutex _bookmarksmutex
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

Public Functions

bool containsFileEntries(const QMimeData*)

Checks if a QMimeData contains any file entries we understand.

QMimeData *getMimeDataFromFilesystemNodes(QList<std::shared_ptr<sh::filesystem::FilesystemNode>>, DataExchangeType type)

Returns a new QMimeData for a list of filesystem nodes and an exchange type.

std::shared_ptr<sh::actions::AbstractActionItem> createCopyAction(const QMimeData *src, std::shared_ptr<const sh::filesystem::Eurl> dest)

Returns a copy action for a source by QMimeData and a destination eurl.

std::shared_ptr<sh::actions::AbstractActionItem> createMoveAction(const QMimeData *src, std::shared_ptr<const sh::filesystem::Eurl> dest)

Returns a move action for a source by QMimeData and a destination eurl.

std::shared_ptr<sh::actions::AbstractActionItem> createPasteAction(const QMimeData *src, std::shared_ptr<const sh::filesystem::Eurl> dest)

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"
template<class T>
class HistoryTracker
#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

Private Members

QList<T> _items
int _current = -1
class HistoryEntry
#include <historytracker.h>

Public Functions

HistoryEntry(int i, T v)
int index()
T value()

Private Members

int _index
T _value
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.

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
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()
QList<QPair<std::shared_ptr<sh::filesystem::FilesystemNode>, sh::filesystemhandlers::LocalFilesystemHandler*>> getAllLocalParts(std::shared_ptr<filesystem::FilesystemNode> node)

Private Members

QHash<std::shared_ptr<const sh::filesystem::Eurl>, QList<qint64>> dir2watcherids
QHash<qint64, std::shared_ptr<const sh::filesystem::Eurl>> watcherid2dir
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 jsonableToJson(Jsonable *a)

Returns a json string from a Jsonable.

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 return 0 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
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

std::shared_ptr<sh::filesystem::Operation> getOperationForContainer(std::shared_ptr<const sh::filesystem::Eurl> container)

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

void requestThumbnail(std::shared_ptr<sh::filesystem::FilesystemNode> node, int width, int height, std::function<void(QIcon)> callback = 0)

Requests a thumbnail in a given size for a given node.

Parameters
  • callback: Called when the thumbnail is ready.

bool getThumbnail(std::shared_ptr<sh::filesystem::FilesystemNode> node, int width, int height, QIcon *result, bool *outdated = 0, bool *refreshRequested = 0)

Returns a thumbnail in a given size for a given node from the current cache.

void invalidateCache()

Invalidates the thumbnail cache.

void addThumbnailProvider(int index, std::shared_ptr<ThumbnailProvider> provider)

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

void thumbnailAvailable(std::shared_ptr<sh::filesystem::FilesystemNode> node)

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)

Public Members

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

void getThumbnail(sh::filesystem::Operation *operation, std::shared_ptr<sh::filesystem::FilesystemNode> node, QString contentType, int width, int height, QIcon *icon) = 0
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

std::shared_ptr<QObject> viewEnteredDirectory(std::shared_ptr<sh::filesystem::FilesystemNode> dir)

Called when a view enters the given directory node. .

void registerOnEnteredHandlers(std::function<void(std::shared_ptr<sh::filesystem::FilesystemNode> dir)> handler)

Registers a function to be called whenever the view just entered the given directory node.

void registerOnLeftHandlers(std::function<void(std::shared_ptr<sh::filesystem::FilesystemNode> dir)> handler)

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()
void findAccounts(std::shared_ptr<Account> pattern, QList<std::shared_ptr<Account>> &result) = 0

Finds account info by a given pattern.

bool storeAccount(std::shared_ptr<Account> account) = 0

Stores account infos.

class Account
#include <accountsmanager.h>

Account data (for accessing network drives).

Public Functions

Account() = default
Account(const Account &other) = default

Public Members

QString username
QString domain
QString server
int serverport = -1
QString path
QString protocol
QString authtype
QByteArray authinfo
class AccountsManager : public sh::base::Singleton
#include <accountsmanager.h>

Storage for account data (for accessing network drives).

Public Functions

QList<std::shared_ptr<Account>> findAccounts(std::shared_ptr<Account> pattern)

Finds account infos by a given pattern.

void storeAccount(std::shared_ptr<Account> account)

Stores account infos.

void registerProvider(std::shared_ptr<AbstractAccountsProvider> provider)

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()

Private Members

QList<std::shared_ptr<AbstractAccountsProvider>> accountsproviders
QMutex mutex
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()
void findAccounts(std::shared_ptr<Account> pattern, QList<std::shared_ptr<Account>> &result)

Finds account info by a given pattern.

bool storeAccount(std::shared_ptr<Account> account)

Stores account infos.

Public Static Functions

void doInitialize()
void doShutdown()

Private Functions

QList<std::shared_ptr<Account>> _find_rem_account_helper(std::shared_ptr<Account> pattern, bool remove)

Private Members

QString accountsdir
class LibsecretAccountsProvider : public sh::tools::accounts::AbstractAccountsProvider
#include <libsecretaccountsprovider.h>

An accounts provider based on gnome-keyring.

Public Functions

LibsecretAccountsProvider()
void findAccounts(std::shared_ptr<Account> pattern, QList<std::shared_ptr<Account>> &result)

Finds account info by a given pattern.

bool storeAccount(std::shared_ptr<Account> account)

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()
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

QString determineMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Determines the mimetype for one file.

QHash<std::shared_ptr<const sh::filesystem::Eurl>, QString> determineMimetype(sh::filesystem::Operation *op, QList<std::shared_ptr<const sh::filesystem::Eurl>> items)

Determines the mimetypes for a list of files.

QList<std::shared_ptr<OpenMethod>> getOpenMethods(QString mimetype, QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)

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

QHash<std::shared_ptr<const sh::filesystem::Eurl>, QString> determineMimetype(sh::filesystem::Operation *op, QList<std::shared_ptr<const sh::filesystem::Eurl>> items) = 0
~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()
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

QList<std::shared_ptr<OpenMethod>> getOpenMethods(QString mimetype, QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) = 0
~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)
QHash<std::shared_ptr<const sh::filesystem::Eurl>, QString> determineMimetype(sh::filesystem::Operation *op, QList<std::shared_ptr<const sh::filesystem::Eurl>> items)

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()
QList<std::shared_ptr<sh::tools::filetypes::OpenMethod>> getOpenMethods(QString mimetype, QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)

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
bool hidden
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()
QHash<std::shared_ptr<const sh::filesystem::Eurl>, QString> determineMimetype(sh::filesystem::Operation *op, QList<std::shared_ptr<const sh::filesystem::Eurl>> items)

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)
QHash<std::shared_ptr<const sh::filesystem::Eurl>, QString> determineMimetype(sh::filesystem::Operation *op, QList<std::shared_ptr<const sh::filesystem::Eurl>> items)

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

QList<std::shared_ptr<sh::tools::filetypes::OpenMethod>> getOpenMethods(QString mimetype, QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) override
void storeCustomOpenMethod(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes, QString mimetype, std::shared_ptr<sh::tools::filetypes::OpenMethod> m, bool rememberForMimetype, std::shared_ptr<const sh::filesystem::Eurl> rememberForDirectory, bool rememberForFile)

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
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
void getThumbnail(sh::filesystem::Operation *operation, std::shared_ptr<sh::filesystem::FilesystemNode> node, QString contentType, int width, int height, QIcon *icon) override

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()
void getThumbnail(sh::filesystem::Operation *operation, std::shared_ptr<sh::filesystem::FilesystemNode> node, QString contentType, int width, int height, QIcon *icon) override

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()
void getThumbnail(sh::filesystem::Operation *operation, std::shared_ptr<sh::filesystem::FilesystemNode> node, QString contentType, int width, int height, QIcon *icon) override

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()
void getThumbnail(sh::filesystem::Operation *operation, std::shared_ptr<sh::filesystem::FilesystemNode> node, QString contentType, int width, int height, QIcon *icon) override

Public Static Functions

void doInitialize()
void doShutdown()

Private Members

QColor brandingcolor
namespace ui

User interface.

This is the presentation layer. The classes directly from here are abstract; often even technically, but clearly from conceptual perspective. Find non-abstract user interface implementations in sub-namespaces.

Typedefs

typedef QList<sh::ui::FilePropertyDialogTabActionsView*> TabViewStructWidgets
typedef QPair<std::shared_ptr<sh::ui::FilePropertyDialogTab>, TabViewStructWidgets> TabViewStruct

Enums

enum ExceptionDialogResult

Enumeration of decisions the user can make in an ExceptionDialog.

Values:

enumerator Shutdown
enumerator Close
enumerator Cancel
enumerator Retry
enum FileViewMode

Values:

enumerator IconView
enumerator ListView
class _ActionExecutionInfoPanel_HelperQObject : public QObject
#include <actionexecutioninfopanel.h>

A helper for some signal/slot stuff of in ActionExecutionInfoPanel.

Public Functions

void _emit_clicked()
void _emit_visibilityChanged()

Signals

void clicked()
void visibilityChanged()
class _FilePropertyDialogTabActionsView_HelperQObject : public QObject
#include <filepropertydialogtabactionsview.h>

A helper for some signal/slot stuff of in FilePropertyDialogTabActionsView.

Public Functions

void _emit_buttonTriggered(int i)

Signals

void buttonTriggered(int i)
class _MainWindow_HelperQObject : public QObject
#include <mainwindow.h>

A helper for some signal/slot stuff of in MainWindow.

Public Functions

void _emit_currentDirectoryChanged()
void _emit_globalViewOptionsChanged()
void _emit_currentProfileChanged()
void _emit_currentFileViewChanged()
void _emit_fileViewCountChanged()
void _emit_fileViewOptionsChanged(int i)

Signals

void currentDirectoryChanged()
void globalViewOptionsChanged()
void currentProfileChanged()
void currentFileViewChanged()
void fileViewCountChanged()
void fileViewOptionsChanged(int)
class _SearchPanelConfiguration_HelperQObject : public QObject
#include <searchpanelconfiguration.h>

A helper for some signal/slot stuff of in SearchPanelConfiguration.

class AboutDialog : public sh::ui::Dialog
#include <aboutdialog.h>

The ‘About’ dialog.

Subclassed by sh::ui::qt::QtAboutDialog, sh::ui::web::WebAboutDialog

Public Functions

AboutDialog()
qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

class ActionExecutionInfoDialog : public sh::actions::ActionExecutionUserFeedback
#include <actionexecutioninfodialog.h>

Progress dialog for action executions.

Subclassed by sh::ui::qt::QtActionExecutionInfoDialog, sh::ui::web::WebActionExecutionInfoDialog

Public Types

enum MessageBoxButton

Buttons in a message box from ActionExecutionUserFeedback.

Values:

enumerator NONE = 0
enumerator OK = 1 << 0
enumerator Continue = 1 << 1
enumerator Cancel = 1 << 2
enumerator Retry = 1 << 3
enumerator Yes = 1 << 4
enumerator No = 1 << 5

Public Functions

ActionExecutionInfoDialog(sh::actions::ActionExecutionInfo *info)
void setDetails(QString fv, QString fob, QString tv, QString tob) = 0

Sets the item details text (‘from a/foo.jpg’, ‘to b/foo.jpg’). .

void setHead(QString txt) = 0

Sets the header text. .

void setProgress(bool isDeterminate, quint64 done, quint64 all, QString text) = 0

Sets the progress. .

bool isLogicallyVisible()

Returns if this dialog is logically visible (i.e. set visible by the action).

void setLogicallyVisible(bool v)

Sets if this dialog is logically visible (i.e. set visible by the action). .

bool isBackground()

Returns if this dialog is currently in background mode (i.e. not visible).

void setBackground(bool v)

Sets if this dialog is currently in background mode (i.e. not visible). .

void setForceForeground(bool v)

Sets if this dialog is currently forced to be visible in foreground. .

int messageBox(QString text, QList<QString> answers, QString icon = QString(), int defaultanswer = -1, int cancelanswer = -1, QList<QString> answericons = QList<QString>()) = 0
int inputBox(QString text, QList<QString> answers, QString *value, QString icon = QString(), int defaultanswer = -1, int cancelanswer = -1, int valuePreselectFrom = -1, int valuePreselectTo = -1) = 0
int multilineInputBox(QString text, QList<QString> answers, QString *value, QString icon = QString(), int defaultanswer = -1, int cancelanswer = -1) = 0
int simpleChooserGridform(QString text, GridformEntries *entries, QStringList answers, int defaultanswer = -1, int cancelanswer = -1) = 0
bool credentialsDialog(QString text, bool showDomain, bool showUsername, bool showPassword, bool showAnonymous, bool showRemember, QString *domain, QString *username, QString *password, bool *isAnonymous, bool *isRemember) = 0
bool unixPermissionsDialog(bool *userMayRead, bool *userMayWrite, bool *userMayExecute, bool *groupMayRead, bool *groupMayWrite, bool *groupMayExecute, bool *othersMayRead, bool *othersMayWrite, bool *othersMayExecute, bool *sticky, bool *setuid, bool *setgid, QStringList users, QStringList groups, QString *ownerUser, QString *ownerGroup) = 0
QString simpleInputBox(QString text, QString deflt, int valuePreselectFrom = -1, int valuePreselectTo = -1)
int simpleMessageBox(QString text, int buttons = (int)MessageBoxButton::OK, QString icon = QString(), int defaultbutton = (MessageBoxButton)0, int cancelbutton = (MessageBoxButton)0)
class ActionExecutionInfoPanel
#include <actionexecutioninfopanel.h>

Abstract class for a status bar info-panel for an action execution.

Subclassed by sh::ui::qt::QtActionExecutionInfoPanel, sh::ui::web::WebActionExecutionInfoPanel

Public Functions

void setLabel(QString s) = 0

Sets the label text. .

void setProgress(bool isProgressDeterminate, quint64 progressDone, quint64 progressAll) = 0

Sets the progress. .

void setForceForeground(bool v) = 0

Sets if the associated action is currently forced to be visible in foreground. .

void setPanelVisible(bool v) = 0

Sets if the panel is visible. .

void setWidth(int width) = 0

Sets the panel with (in pixels). .

void onClicked(std::function<void()> fctQObject *owner = 0, )

Sets a handler for a click on the button (optionally bound to an owner lifetime).

void onDestroyed(std::function<void()> fctQObject *owner = 0, )

Sets a handler for panel removal (optionally bound to an owner lifetime).

void onVisibilityChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for panel visibility changes (optionally bound to an owner lifetime).

~ActionExecutionInfoPanel()
class ColumnDimensions
#include <columndimensions.h>

Auxiliary data structure for persistent column dimensions.

It stores the width of a column whenever it changes and restores it when needed (mostly when Shallot starts).

Public Functions

ColumnDimensions(int index)

Constructed only by the infrastructure and made available otherwise.

void store()
bool remove()
void setWidth(QString col, int width)
int getWidth(QString col, int defaultval)

Public Members

int index

Private Functions

std::unique_ptr<QSettings> db()

Private Members

QHash<QString, int> dims
class Dialog : public std::enable_shared_from_this<Dialog>
#include <dialog.h>

Abstract subclass for Shallot dialogs (in child windows).

Subclasses of Dialog represent particular dialog types (like ManageBookmarksDialog).

For each ui mode, there typically is an implementation for all of these types, implementing one of this dialog types subclasses (mentioned before) and also some ui mode specific class.

Note: Unless stated otherwise, all methods must be called from main thread!

Note: It’s not allowed to show one web dialog instance more than once. After closing it, it’s sole use is to fetch answer data from it.

Note: You should not create instances directly. It’s required to use DialogManager::createAndShowDialog() for actually showing those dialogs. Even this should not be used directly, because call depends on the current ui mode. Use the show*() methods in sh::ui::MainWindow for creating dialogs in a ui mode independent way.

Subclassed by sh::ui::AboutDialog, sh::ui::ExceptionDialog, sh::ui::FilePropertyDialog, sh::ui::LogViewDialog, sh::ui::ManageBookmarksDialog, sh::ui::ManageProfilesDialog, sh::ui::OpenWithDialog, sh::ui::StoreProfileDialog, sh::ui::TuningDialog

Public Functions

Dialog()
~Dialog()
qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Functions

void setup(DialogManager *manager, qint64 dialogId)

Sets manager and id for this dialog (right after creation).

Private Members

DialogManager *_manager
qint64 _dialogId = -1
bool _closed = false
bool _inited = false

Friends

friend class MainWindow
friend class DialogManager
class DialogManager
#include <dialog.h>

Creates and drives dialogs (in child windows), i.e. instances of Dialog.

Subclass it for implementing the low level mechanisms for handling dialogs in a particular ui mode (e.g. qt, web).

The infrastructure will use one of this implementations for creating and managing most kinds of dialogs.

Subclassed by sh::ui::qt::QtDialogManager, sh::ui::web::WebDialogManager

Public Functions

std::shared_ptr<Dialog> getDialogById(qint64 id)

Returns a Dialog by dialog id.

Must be called in main thread.

QList<std::shared_ptr<Dialog>> getAllDialogs()

Returns a list of all dialogs currently shown (in order of creation).

Must be called in main thread.

QList<qint64> getAllDialogIds()

Returns a list of dialog ids of all dialogs currently shown (in order of creation).

Must be called in main thread.

template<class TDlg, typename ...Args>
std::shared_ptr<TDlg> createAndShowDialog(Args... args)

Creates and shows a Dialog by class and constructor parameters.

Those dialogs (TDlg) have to implement Dialog (typically a subclass of it, representing a particular dialog, like FilePropertyDialog), and also some ui mode (e.g. qt, web) specific class (depends on that ui mode).

You typically should not have to use it outside of MainWindow or subclasses. The MainWindow interface allows to create all available dialogs in a ui mode independent way.

May be called in any thread.

Return

The created Dialog instance.

~DialogManager()

Private Functions

void closeDialog(std::shared_ptr<Dialog> dialog)

Closes this dialog, including internal bookkeeping.

Must be called in main thread.

void initAndShowDialog(std::shared_ptr<Dialog> dialog)

Initializes and shows a freshly created dialog.

Must be called in main thread.

bool wasAccepted(std::shared_ptr<Dialog> dialog) = 0

Returns if the dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

The result is undefined before the dialog was closed.

Must be called in main thread.

void waitClosed(std::shared_ptr<Dialog> dialog) = 0

Wait until the user closed the dialog in some way.

May be called in any thread.

void stopDialog(std::shared_ptr<Dialog> dialog) = 0

This method implements the ui mode specific mechanism for stopping (i.e. closing) a dialog.

Must be called in main thread.

void showDialog(std::shared_ptr<Dialog> dialog) = 0

This method implements the ui mode specific mechanism for showing a dialog.

Must be called in main thread.

Private Members

QHash<qint64, std::shared_ptr<Dialog>> _openDialogs
qint64 _nextDialogId = 0

Friends

friend class Dialog
class ExceptionDialog : public sh::ui::Dialog
#include <exceptiondialog.h>

The ‘Exception’ dialog.

Subclassed by sh::ui::qt::QtExceptionDialog, sh::ui::web::WebExceptionDialog

Public Functions

ExceptionDialog(QString error1, QString error2, QString details, QString icon, bool mayRetry, bool mayClose, bool mayCancel, bool showLoglabelAndDetails)

Parameters
  • error1: The 1st error text.

  • error2: The 2nd error text.

  • details: The error details.

  • icon: An icon (as name resolveable by sh::base::IconManager).

  • mayRetry: If it’s allowed to retry.

  • mayClose: If it’s allowed to just close and continue without closing Shallot.

  • mayCancel: If it’s allowed to cancel, i.e. throwing a sh::exceptions::CancelException.

  • showLoglabelAndDetails: If the dialog shall allow to read the details.

QString error1()

Returns the 1st error text.

QString error2()

Returns the 2nd error text.

QString details()

Returns the error details.

QString icon()

Returns the icon (as name resolveable by sh::base::IconManager).

bool mayRetry()

Returns if it’s allowed to retry.

bool mayClose()

Returns if it’s allowed to just close and continue without closing Shallot.

bool mayCancel()

Returns if it’s allowed to cancel, i.e. throwing a sh::exceptions::CancelException.

bool showLoglabelAndDetails()

Returns if the dialog shall allow to read the details.

ExceptionDialogResult answer() = 0

Returns the answer the user has given in this dialog.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Members

QString _error1
QString _error2
QString _details
QString _icon
bool _mayRetry
bool _mayClose
bool _mayCancel
bool _showLoglabelAndDetails
class FilePropertyDialog : public sh::ui::Dialog
#include <filepropertydialog.h>

The ‘File Properties’ dialog.

Subclassed by sh::ui::qt::QtFilePropertyDialog, sh::ui::web::WebFilePropertyDialog

Public Functions

~FilePropertyDialog()
FilePropertyDialog(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void refresh() = 0

Refreshes the dialog content.

QList<std::shared_ptr<FilePropertyDialogTab>> tabs()

Returns a list of all tabs.

sh::ui::FilePropertyDialogTabActionsView *widgetAt(std::shared_ptr<FilePropertyDialogTab> tab, int i)

Returns the widget from a tab at a certain index.

int widgetCount(std::shared_ptr<FilePropertyDialogTab> tab)

Returns the number of widgets in a tab.

sh::ui::FilePropertyDialogTabTableView *createTabViewTable() = 0

Creates a new tab view table sub-widget.

sh::ui::FilePropertyDialogTabTextView *createTabViewText() = 0

Creates a new tab view text sub-widget.

sh::ui::FilePropertyDialogTabIconTextBannerView *createTabViewIconTextBanner() = 0

Creates a new tab view icon text banner sub-widget.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Public Static Functions

void addTabFactory(int i, std::shared_ptr<FilePropertyDialogTabFactory> factory)

Adds a FilePropertyDialogTabFactory so the Properties dialogs show its content.

See also the REGISTER_FILEPROPERTYDIALOGTAB macro.

Parameters
  • i: An index which controls the display order. Use one of the REGISTER_FILEPROPERTYDIALOGTAB_INDEX_* values in FilePropertyDialogTabFactory as base values.

Private Members

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> _nodes
QList<TabViewStruct> _tabs

Private Static Attributes

QHash<int, std::shared_ptr<FilePropertyDialogTabFactory>> _propertytabs

Friends

friend class FilePropertyDialogTab
class FilePropertyDialogTab : public std::enable_shared_from_this<FilePropertyDialogTab>
#include <filepropertydialog.h>

Abstract base class for one tab in the Properties dialog (containing a list of widgets).

Subclass and register this class for providing additional content in the Properties dialog.

Register it by using the REGISTER_FILEPROPERTYDIALOGTAB macro (or by adding a FilePropertyDialogTabFactory via FilePropertyDialog::addTabFactory).

Subclassed by sh::filepropertydialogtabs::FilePropertyDialogTabExtendedAttributes, sh::filepropertydialogtabs::FilePropertyDialogTabGeneral, sh::filepropertydialogtabs::FilePropertyDialogTabUnixPermissions, sh::filepropertydialogtabs::FilePropertyDialogTabWindows, sh::scripting::api::ApiFilePropertyDialogTab

Public Functions

QString title() = 0

The tab title. .

QString titleWithoutMnemonic()

The tab title without mnemonic.

QList<QString> properties() = 0

Returns the list of property labels (one entry for each widget).

Each property is displayed with a header and a widget (created in createWidget) with some content (populated in updateWidget).

void populateWidget(int i, FilePropertyDialogTabActionsView *widget) = 0

Populates the tab widget for the i-th property.

Typically uses the FilePropertyDialog::create* methods to create sub-widgets.

See also dialog().

void updateWidget(int i, FilePropertyDialogTabActionsView *widget, sh::filesystem::Operation *op) = 0

Populates the widget for the i-th property with actual content. .

void refresh()

Refreshes the complete content.

Typically called after some user actions in a property widget require that all the other content must be refreshed.

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes()

The nodes to show.

FilePropertyDialogTabActionsView *widgetAt(int i)

Returns the widget for the i-th property.

int widgetCount()

Returns the number of widgets.

std::shared_ptr<FilePropertyDialog> dialog()

Returns the associated dialog.

~FilePropertyDialogTab()

Private Members

std::weak_ptr<FilePropertyDialog> _dialog

Friends

friend class FilePropertyDialog
friend class FilePropertyDialogTabFactoryByFunction
friend class sh::scripting::api::ApiFilePropertyDialogTabFactory
class FilePropertyDialogTabActionsView
#include <filepropertydialogtabactionsview.h>

A tab view which shows a main widget in the main part and some buttons below.

Subclassed by sh::ui::qt::QtFilePropertyDialogTabActionsView, sh::ui::web::WebFilePropertyDialog::WebFilePropertyDialogTabActionsView

Public Functions

FilePropertyDialogTabActionsView()

Is intended to be directly constructed from everywhere.

FilePropertyDialogTabViewContent *content()

The main widget.

void setContent(FilePropertyDialogTabViewContent *cnt)

Sets the main widget. .

QList<QString> buttons()

The list of buttons.

void setButtons(QList<QString> buttons)

Sets the list of buttons. .

void setVisible(bool v) = 0

Sets the view visible or hidden. .

void onButtonTriggered(std::function<void(int i)> fct, QObject *owner = 0, )

Sets a handler for a click on one of the buttons (optionally bound to an owner lifetime).

class FilePropertyDialogTabFactory
#include <filepropertydialog.h>

Abstract factory for creating property dialog tabs for the selected nodes.

Register an instance of this class with FilePropertyDialog::addTabFactory in order to make a property tab implementation available. See also FilePropertyDialogTabFactoryByFunction.

Subclassed by sh::scripting::api::ApiFilePropertyDialogTabFactory, sh::ui::FilePropertyDialogTabFactoryByFunction

Public Functions

std::shared_ptr<sh::ui::FilePropertyDialogTab> construct(std::shared_ptr<sh::ui::FilePropertyDialog> dialog) = 0

Constructs a fresh instance of a FilePropertyDialogTab implementation. .

~FilePropertyDialogTabFactory()

Public Static Attributes

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_CORE = 10000

Base value for display indexes of core (i.e. maximum important) tabs.

Used in FilePropertyDialog::addTabFactory.

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_VERYIMPORTANT = 20000

Base value for display indexes of very important tabs.

Used in FilePropertyDialog::addTabFactory.

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_IMPORTANT = 30000

Base value for display indexes of important tabs.

Used in FilePropertyDialog::addTabFactory.

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_NORMAL = 40000

Base value for display indexes of tabs with medium importance.

Used in FilePropertyDialog::addTabFactory.

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_EXOTIC = 50000

Base value for display indexes of exotic (i.e. less important) tabs.

Used in FilePropertyDialog::addTabFactory.

class FilePropertyDialogTabFactoryByFunction : public sh::ui::FilePropertyDialogTabFactory
#include <filepropertydialog.h>

Implementation of FilePropertyDialogTabFactory for making custom FilePropertyDialogTab implementations available.

This implementation relies on an external factory function which must be provided to the constructor.

Used internally inside the REGISTER_FILEPROPERTYDIALOGTAB macro.

Public Functions

FilePropertyDialogTabFactoryByFunction(std::function<std::shared_ptr<sh::ui::FilePropertyDialogTab>()> fct)
std::shared_ptr<sh::ui::FilePropertyDialogTab> construct(std::shared_ptr<sh::ui::FilePropertyDialog> dialog)

Constructs a fresh instance of a FilePropertyDialogTab implementation. .

Public Static Attributes

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_CORE = 10000

Base value for display indexes of core (i.e. maximum important) tabs.

Used in FilePropertyDialog::addTabFactory.

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_VERYIMPORTANT = 20000

Base value for display indexes of very important tabs.

Used in FilePropertyDialog::addTabFactory.

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_IMPORTANT = 30000

Base value for display indexes of important tabs.

Used in FilePropertyDialog::addTabFactory.

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_NORMAL = 40000

Base value for display indexes of tabs with medium importance.

Used in FilePropertyDialog::addTabFactory.

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_EXOTIC = 50000

Base value for display indexes of exotic (i.e. less important) tabs.

Used in FilePropertyDialog::addTabFactory.

Private Members

std::function< std::shared_ptr< sh::ui::FilePropertyDialogTab >)> fct
class FilePropertyDialogTabIconTextBannerView : public sh::ui::FilePropertyDialogTabViewContent
#include <filepropertydialogtabactionsview.h>

A tab view for showing texts and icons combined.

Subclassed by sh::ui::qt::QtFilePropertyDialogTabIconTextBannerView, sh::ui::web::WebFilePropertyDialog::WebFilePropertyDialogTabIconTextBannerView

Public Functions

FilePropertyDialogTabIconTextBannerView()

Is intended to be directly constructed from everywhere.

void clear() = 0

Clears the contents.

void insertIcon(QIcon icon, int sizePt = 24) = 0

Adds an icon.

void insertText(QString text) = 0

Adds a text.

class FilePropertyDialogTabTableView : public sh::ui::FilePropertyDialogTabViewContent
#include <filepropertydialogtabactionsview.h>

A tab view for showing key/value pairs.

Subclassed by sh::ui::qt::QtFilePropertyDialogTabTableView, sh::ui::web::WebFilePropertyDialog::WebFilePropertyDialogTabTableView

Public Types

typedef QPair<int, int> ItemIndex

Public Functions

FilePropertyDialogTabTableView()

Is intended to be directly constructed from everywhere.

void setContent(QList<QPair<QString, QString>> content) = 0

Sets the content.

QList<ItemIndex> getSelectedItems() = 0

Returns the selected cells.

QVariant getItemValue(int r, int c) = 0

Returns a value of a cell.

class FilePropertyDialogTabTextView : public sh::ui::FilePropertyDialogTabViewContent
#include <filepropertydialogtabactionsview.h>

A tab view for showing a text.

Subclassed by sh::ui::qt::QtFilePropertyDialogTabTextView, sh::ui::web::WebFilePropertyDialog::WebFilePropertyDialogTabTextView

Public Functions

FilePropertyDialogTabTextView()

Is intended to be directly constructed from everywhere.

void setContent(QString content) = 0

Sets the content.

class FilePropertyDialogTabViewContent
#include <filepropertydialogtabactionsview.h>

Abstract subclass for a tab view content.

Subclassed by sh::ui::FilePropertyDialogTabIconTextBannerView, sh::ui::FilePropertyDialogTabTableView, sh::ui::FilePropertyDialogTabTextView

Public Functions

FilePropertyDialogTabViewContent()
~FilePropertyDialogTabViewContent()
class FileView : public QObject
#include <fileview.h>

Abstract base class for a file view implementation (i.e. which shows the content of a directory somehow).

Subclassed by sh::ui::qt::QtFileViewControl, sh::ui::web::WebFileView

Public Functions

FileView()
~FileView()
sh::ui::ColumnDimensions *columndimensions() = 0

Returns the column dimensions handler. .

sh::tools::HistoryTracker<std::shared_ptr<const sh::filesystem::Eurl>> *historyTracker() = 0

Returns the history tracker. .

FileViewMode viewmode() = 0

Returns the view mode (icons, list, … ?). .

void setViewmode(FileViewMode m) = 0

Sets the view mode. .

int index() = 0

Returns the position of this file view within the panel. .

std::shared_ptr<sh::filesystem::FilesystemNode> node()

Returns the current directory.

void gotoDir(std::shared_ptr<sh::filesystem::FilesystemNode> node)

Jumps to a new current directory.

Implementations have to call the base class implementation inside.

sh::filesystem::SizeFormatting getSizeFormattingMode() = 0

Returns the mode how file sizes are formatted for displaying. .

void setSizeFormattingMode(sh::filesystem::SizeFormatting mode) = 0

Sets the mode how file sizes are formatted for displaying. .

bool hiddenFilesVisible() = 0

Returns if hidden files are visible. .

void setHiddenFilesVisible(bool v) = 0

Sets the visibility of hidden files. .

int iconDimension() = 0

Returns the icon size (in pixels). .

void setIconDimension(int v) = 0

Sets the icon size (in pixels). .

void setSort(int column, Qt::SortOrder order) = 0

Sets how to sort this view. .

int sortColumn() = 0

Returns the index of the current sort column. .

Qt::SortOrder sortOrder() = 0

Returns the current sort order. .

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> selectedNodes() = 0

Returns the nodes which the user has selected in this fileview. .

void setSelection(const QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) = 0

Sets the node selection of this fileview. .

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> getAllVisibleNodes() = 0

Returns a list of all nodes currently listed in this file view. .

void reload(bool skipModel = false)

Reloads the data inside this file view.

sh::filesystem::FilesystemModelFileviewProxy *filemodel()

Returns the filesystem model for this view. .

void setFilemodel(sh::filesystem::FilesystemModelFileviewProxy *model)

Sets the filesystem model for this view. .

Signals

void selectionChanged()

Triggered when the selection have changed.

void viewOptionChanged()

Triggered when some view options have changed.

Private Members

sh::filesystem::FilesystemModelFileviewProxy *_model = nullptr
std::shared_ptr<QObject> _visibleviewslifetimecanary = nullptr
std::shared_ptr<sh::filesystem::FilesystemNode> _node = nullptr
class LogViewDialog : public sh::ui::Dialog
#include <logviewdialog.h>

The ‘Log’ dialog..

Subclassed by sh::ui::qt::QtLogViewDialog, sh::ui::web::WebLogViewDialog

Public Functions

LogViewDialog(QString headtext, QString subheadtxt, sh::base::LogSeverity minseverity)

Parameters
  • headtext: The header text.

  • subheadtxt: The 2nd header text.

  • minseverity: The minimum message severity this dialog shows initially (the user can typically change that later on).

QString headtext()

Returns the header text.

QString subheadtxt()

Returns the 2nd header text.

sh::base::LogSeverity minimumSeverity()

Returns the minimum severity.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Members

QString _headtext
QString _subheadtxt
sh::base::LogSeverity _minseverity
class MainWindow
#include <mainwindow.h>

The abstract main window class. There is one instance of it, and it is also used for other ui parts (e.g. creating some dialogs, …).

Subclassed by sh::ui::qt::QtMainWindow, sh::ui::web::WebMainWindow

Public Functions

MainWindow()
~MainWindow()
void _initialize(sh::base::SingletonInitializer *singletonInitializer)

Initializes the main window. For custom initialization logic, see MainWindow.initialize. .

int fileViewCount() = 0

Returns the current number of file views. .

void addFileView(bool reinitialize = false) = 0

Adds a new file view. .

void removeFileView(int i) = 0

Removes a file view. .

sh::ui::FileView *currentFileView() = 0

Returns the file view which is currently active (i.e. focussed). .

sh::ui::FileView *getFileView(int i) = 0

Returns a file view by position index. .

void fileViewsReloadAll()

Reload all content in each file view.

void onFileViewOptionsChanged(std::function<void(int)> fct, QObject *owner = 0, )

Sets a handler for some view options in a file view changed (optionally bound to an owner lifetime).

void onCurrentFileViewChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for the currently active file view changed (optionally bound to an owner lifetime).

void onFileViewCountChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for the number of file views changed (optionally bound to an owner lifetime).

void onCurrentDirectoryChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for the current directory in the active file view changed (optionally bound to an owner lifetime).

void onGlobalViewOptionsChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for some global view options changed (optionally bound to an owner lifetime).

void onCurrentProfileChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for the current profile changed (optionally bound to an owner lifetime).

void jumpToEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Let the current view jump to another location. .

void jumpToNode(std::shared_ptr<sh::filesystem::FilesystemNode> node) = 0

Let the current view jump to another location. .

void setTitlePattern(QString value)

Sets the window title pattern. .

QString titlePattern()

Returns the window title pattern.

void setCurrentProfile(QString profile)

Sets the current profile. .

QString currentProfile()

Returns the current profile.

void reloadProfile()

Reloads the profile data.

void setTreeVisible(bool v)

Sets the visibility of the directory tree. .

bool treeVisible()

Returns the visibility of the directory tree.

void setTreeSticky(bool v)

Sets if the directory tree should follow the active file view. .

bool treeSticky()

Returns if the directory tree follows the active file view.

void setFileDetailsPanelVisible(bool v)

Sets the visibility of the file details panel. .

bool fileDetailsPanelVisible()

Returns the visibility of the file details panel.

std::shared_ptr<sh::filesystem::FilesystemNode> currentDirectory() = 0

Gets the sh::filesystem::FilesystemNode selected in the current view. .

std::shared_ptr<sh::ui::ActionExecutionInfoPanel> addInfoPanel(int position, sh::actions::ActionExecutionInfo *info, QColor color = QColor()) = 0

Creates a new action execution panel.

Let this smart pointer die for removing it.

std::shared_ptr<sh::ui::ActionExecutionInfoPanel> addInfoPanel(sh::actions::ActionExecutionInfo *info, QColor color = QColor())

Creates a new action execution panel.

Let this smart pointer die for removing it.

void jumpbarSetTextMode() = 0

Sets the jumpbar to text input mode. .

void jumpbarSetButtonMode() = 0

Sets the jumpbar to button mode. .

bool jumpbarIsTextMode() = 0

Returns if the jumpbar is in text input mode. .

QString toolbarPosition() = 0

Returns the current toolbar position. .

void setToolbarPosition(QString pos) = 0

Sets the toolbar position. .

QString detailPanelPosition() = 0

Returns the current detail panel position. .

void setDetailPanelPosition(QString pos) = 0

Sets the detail panel position. .

std::shared_ptr<AboutDialog> showAboutDialog() = 0

Shows and returns an ‘About’ dialog. .

std::shared_ptr<ManageProfilesDialog> showManageProfilesDialog() = 0

Shows and returns a ‘Manage Saved Settings’ dialog. .

std::shared_ptr<OpenWithDialog> showOpenWithDialog(std::shared_ptr<sh::filesystem::FilesystemNode> node, QList<std::shared_ptr<sh::tools::filetypes::OpenMethod>> openMethods) = 0

Shows and returns a ‘Open With’ dialog. .

std::shared_ptr<StoreProfileDialog> showStoreProfileDialog(std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Shows and returns a ‘Save Settings’ dialog. .

std::shared_ptr<TuningDialog> showTuningDialog() = 0

Shows and returns a ‘Tuning’ dialog. .

std::shared_ptr<LogViewDialog> showLogViewDialog(QString headtext = QString(), QString subheadtxt = QString(), sh::base::LogSeverity minseverity = sh::base::LogSeverity::_DEFAULT) = 0

Shows and returns a ‘Log’ dialog. .

std::shared_ptr<ManageBookmarksDialog> showManageBookmarksDialog() = 0

Shows and returns a ‘Manage Bookmarks’ dialog. .

std::shared_ptr<FilePropertyDialog> showFilePropertyDialog(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) = 0

Shows and returns a ‘File Properties’ dialog. .

std::shared_ptr<ActionExecutionInfoDialog> createActionExecutionInfoDialog(sh::actions::ActionExecutionInfo *info) = 0

Creates an action execution dialog. .

std::shared_ptr<ActionExecutionInfoPanel> showErrorPanel()

Shows an error panel.

std::shared_ptr<DialogManager> dialogManager() = 0

Returns the DialogManager which creates and drives Dialogs for this main window.

You typically should not need to use it directly.

void _closeDirectly()

Directly begin application shutdown without checks.

bool closeApp()

Check if the application may shut down now, and if so, initiate it.

bool isCloseable(QString *msg = nullptr)

Check if the application may shut down now.

void handleCloseAppRejected(QString rejectmsg) = 0

React on a rejected application close request (with some feedback message). .

void handleClosed()

Do some cleanup steps just when closing starts. Implementations must call base implementation!

bool isClosing()

Returns if the application is currently closing.

Public Static Functions

MainWindow *mainWindow()

Returns the instance of this singleton.

void setMainWindow(MainWindow *mainWindow)

Sets the main window instance. .

bool isReady()

Returns if this process ui is ready (i.e. is created or runs headless).

bool runsHeadless()

Returns if this process runs headless, i.e. without any ui, just for a background process.

void _closeDirectly(sh::base::SingletonInitializer *singletonInitializer)
QString uiMode()

Returns the UI mode (e.g. qt, web).

Private Functions

void _refreshIsCloseable()

Private Members

bool _closing = false
bool _treeSticky = true
bool _treeVisible = true
bool _detailsPanelVisible = true
QString _titlePattern
QList<std::shared_ptr<sh::ui::ActionExecutionInfoPanel>> _errorpanels
QString _currentProfile
QString _isCloseable
bool _thumbnailrequestongoing = false
bool _thumbnailrequestfollowup = false
int _thumbnailrequestfollowup_width = 0
int _thumbnailrequestfollowup_height = 0
std::function<void()> _thumbnailrequestfollowup_onBeforeRequest = nullptr
std::function<void(QIcon)> _thumbnailrequestfollowup_onArrived = nullptr
int _thumbnaillastreqwidth = 0
int _thumbnaillastreqheight = 0
quint64 _thumbnaillastrequestid = 0

Private Static Attributes

MainWindow *_mainWindow = nullptr
bool _mainWindow_runheadless = false
KillHelperThread *killthread = nullptr

Friends

friend class sh::exceptions::Exception
class KillHelperThread : public QThread

Helps application shutdown in some situations :).

Public Functions

void run()
class ManageBookmarksDialog : public sh::ui::Dialog
#include <managebookmarksdialog.h>

The ‘Manage Bookmarks’ dialog.

Subclassed by sh::ui::qt::QtManageBookmarksDialog, sh::ui::web::WebManageBookmarksDialog

Public Functions

ManageBookmarksDialog()
qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

class ManageProfilesDialog : public sh::ui::Dialog
#include <manageprofilesdialog.h>

The ‘Manage Saved Settings’ dialog.

Subclassed by sh::ui::qt::QtManageProfilesDialog, sh::ui::web::WebManageProfilesDialog

Public Functions

ManageProfilesDialog()
qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

class OpenWithDialog : public sh::ui::Dialog
#include <openwithdialog.h>

The ‘Open With’ dialog.

Subclassed by sh::ui::qt::QtOpenWithDialog, sh::ui::web::WebOpenWithDialog

Public Functions

OpenWithDialog(std::shared_ptr<sh::filesystem::FilesystemNode> node, QList<std::shared_ptr<sh::tools::filetypes::OpenMethod>> openMethods)

Parameters
  • node: The file which is later to be opened.

  • openMethods: The open-methods (programs for opening the file) to present for choice.

std::shared_ptr<sh::tools::filetypes::OpenMethod> chosenMethod() = 0

Returns the chosen open-method (program for opening the file).

bool rememberForMimetype() = 0

Returns if the chosen method is checked to be remembered for the same mime-type in the future.

std::shared_ptr<const sh::filesystem::Eurl> rememberForDirectory() = 0

If it’s checked for the chosen method to be remembered for some subdirectory in the future, it returns the Eurl of this subdirectory, otherwise nullptr.

bool rememberForFile() = 0

Returns if the chosen method is checked to be remembered for the same file in the future.

std::shared_ptr<sh::filesystem::FilesystemNode> node()

Returns the file node which is later to be opened.

QList<std::shared_ptr<tools::filetypes::OpenMethod>> openMethods()

Returns the open-methods (programs for opening the file) to present for choice.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Members

std::shared_ptr<sh::filesystem::FilesystemNode> _node
QList<std::shared_ptr<sh::tools::filetypes::OpenMethod>> _openMethods
class SearchPanelAbstractEditor
#include <searchpanelconfiguration.h>

Abstract base class for editor widgets in a search panel.

Subclassed by sh::ui::SearchPanelDateTimeEditor, sh::ui::SearchPanelLabelEditor, sh::ui::SearchPanelSpacerEditor, sh::ui::SearchPanelTextEditor

Public Functions

SearchPanelAbstractEditor() = default
~SearchPanelAbstractEditor() = default
bool isWidgetEnabled() = 0

Returns if the widget is enabled. .

void setWidgetEnabled(bool v) = 0

Sets if the widget is enabled. .

class SearchPanelButton
#include <searchpanelconfiguration.h>

A button in the button bar of a search panel.

Subclassed by sh::ui::qt::QtSearchPanelButton

Public Functions

SearchPanelButton()
~SearchPanelButton()
void setButtonText(QString txt) = 0

Sets the button text. .

void setMenuSelection(int i) = 0

Sets the currently selected menu item (for buttons with menus). .

class SearchPanelConfiguration
#include <searchpanelconfiguration.h>

Configuration for a search panel population.

It is populated with ui controls by the chosen search criterion. Later on those controls are used for updating the configuration data.

Subclassed by sh::ui::qt::QtSearchPanelConfiguration

Public Functions

SearchPanelConfiguration()
~SearchPanelConfiguration()
SearchPanelButton *addMenuButton(QString text, QStringList menu, std::function<void(int)> onchanged) = 0

Adds and returns a button for a menu. .

SearchPanelButton *addActionButton(QString text, std::function<void()> action) = 0

Adds and returns a button for an action. .

SearchPanelTextEditor *addTextEditor() = 0

Adds and returns a text editor. .

SearchPanelDateTimeEditor *addDateTimeEditor() = 0

Adds and returns a date/time editor. .

SearchPanelLabelEditor *addLabel() = 0

Adds and returns a label. .

SearchPanelSpacerEditor *addSpacer() = 0

Adds and returns a spacer. .

SearchPanelAbstractEditor *getEditorAt(int i) = 0

Returns the editor widget at a given position. .

void onDestroyed(std::function<void()> fctQObject *owner = 0, )

Sets a handler for panel removal (optionally bound to an owner lifetime).

Public Members

_SearchPanelConfiguration_HelperQObject myqobject
class SearchPanelDateTimeEditor : public sh::ui::SearchPanelAbstractEditor
#include <searchpanelconfiguration.h>

A date/time picker for search panel usage.

Subclassed by sh::ui::qt::QtSearchPanelAbstractEditor< QDateTimeEdit, SearchPanelDateTimeEditor >

Public Functions

SearchPanelDateTimeEditor() = default
QDateTime datetime() = 0

Returns the selected date/time. .

void setDatetime(QDateTime s) = 0

Sets the selected date/time.

bool isWidgetEnabled() = 0

Returns if the widget is enabled. .

void setWidgetEnabled(bool v) = 0

Sets if the widget is enabled. .

class SearchPanelLabelEditor : public sh::ui::SearchPanelAbstractEditor
#include <searchpanelconfiguration.h>

A text label for search panel usage.

Subclassed by sh::ui::qt::QtSearchPanelAbstractEditor< QLabel, sh::ui::SearchPanelLabelEditor >

Public Functions

SearchPanelLabelEditor() = default
QString textContent() = 0

Returns the text content. .

void setTextContent(QString s) = 0

Sets the text content. .

SearchPanelAbstractEditor *focusProxyEditor() = 0

Returns the focus proxy widget (which focus gets redirected to in some situations). .

void setFocusProxyEditor(SearchPanelAbstractEditor *w) = 0

Sets the focus proxy widget (which focus gets redirected to in some situations). .

bool isWidgetEnabled() = 0

Returns if the widget is enabled. .

void setWidgetEnabled(bool v) = 0

Sets if the widget is enabled. .

class SearchPanelSpacerEditor : public sh::ui::SearchPanelAbstractEditor
#include <searchpanelconfiguration.h>

A spacer for search panel usage.

Subclassed by sh::ui::qt::QtSearchPanelAbstractEditor< QLabel, sh::ui::SearchPanelSpacerEditor >

Public Functions

SearchPanelSpacerEditor() = default
bool isWidgetEnabled() = 0

Returns if the widget is enabled. .

void setWidgetEnabled(bool v) = 0

Sets if the widget is enabled. .

class SearchPanelTextEditor : public sh::ui::SearchPanelAbstractEditor
#include <searchpanelconfiguration.h>

A single line text editor for search panel usage.

Subclassed by sh::ui::qt::QtSearchPanelAbstractEditor< QLineEdit, sh::ui::SearchPanelTextEditor >

Public Functions

SearchPanelTextEditor() = default
QString textContent() = 0

Returns the text content. .

void setTextContent(QString s) = 0

Sets the text content. .

QString placeholderDescription() = 0

Returns the placeholder description text (visible if field is empty). .

void setPlaceholderDescription(QString s) = 0

Sets the placeholder description text (visible if field is empty). .

bool isWidgetEnabled() = 0

Returns if the widget is enabled. .

void setWidgetEnabled(bool v) = 0

Sets if the widget is enabled. .

class StoreProfileDialog : public sh::ui::Dialog
#include <storeprofiledialog.h>

The ‘Save Settings’ dialog.

Subclassed by sh::ui::qt::QtStoreProfileDialog, sh::ui::web::WebStoreProfileDialog

Public Functions

StoreProfileDialog(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Parameters
  • eurl: The current directory this dialog shall work on.

std::shared_ptr<const sh::filesystem::Eurl> eurl()

Returns the current directory this dialog shall work on.

QList<SettingEntry> checkedSettings() = 0

Returns the list of settings the user has checked to store.

QString profileName() = 0

Returns the profile the user has chosen to store settings for.

bool withSubDirectories() = 0

Returns if the user has chosen to apply the checked settings also for subdirectories.

QStringList inheritsFrom() = 0

Returns the list of profiles the user has chosen to inherit from.

bool hasGlobal() = 0

Returns if the user has chosen to apply the checked settings for each directory (instead of the current directory).

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Members

std::shared_ptr<const sh::filesystem::Eurl> _eurl
class SettingEntry
#include <storeprofiledialog.h>

A storable entry in a ‘Save Settings’ dialog.

Public Functions

SettingEntry(sh::settings::Setting *setting, int onlyInFileview = -1)
sh::settings::Setting *setting()

Returns the setting to store.

int fileview()

Returns the index of the file view to store this setting for (or -1 for all).

bool isForFileview()

Returns if this setting is to be stored for a particular file view (instead of for all).

Private Members

sh::settings::Setting *_setting
int _fileview
class TuningDialog : public sh::ui::Dialog
#include <tuningdialog.h>

The ‘Tuning’ dialog.

Subclassed by sh::ui::qt::QtTuningDialog, sh::ui::web::WebTuningDialog

Public Functions

TuningDialog()
qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

namespace qt

The Qt user interface implementation.

This is the default UI. It builds a desktop application based on the Qt gui components.

class LineEditWithKeyboardShortcuts : public QLineEdit
#include <qtjumpbar.h>

Helper widget of QtJumpBar.

Public Functions

LineEditWithKeyboardShortcuts(QWidget *parent = 0)

Signals

void enterPressed()
void escapePressed()
class QtAboutDialog : public sh::ui::qt::QtDialog, public sh::ui::AboutDialog
#include <qtaboutdialog.h>

Qt based about dialog.

Public Functions

QtAboutDialog()
~QtAboutDialog()
qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Members

Ui::QtAboutDialog *ui

Private Slots

void on_btnClose_clicked()
void on_btnLicense_clicked()
void on_btnHomepage_clicked()
class QtActionExecutionInfoDialog : public QDialog, public sh::ui::ActionExecutionInfoDialog
#include <qtactionexecutioninfodialog.h>

Qt progress dialog for action executions.

Public Types

enum MessageBoxButton

Buttons in a message box from ActionExecutionUserFeedback.

Values:

enumerator NONE = 0
enumerator OK = 1 << 0
enumerator Continue = 1 << 1
enumerator Cancel = 1 << 2
enumerator Retry = 1 << 3
enumerator Yes = 1 << 4
enumerator No = 1 << 5

Public Functions

QtActionExecutionInfoDialog(sh::actions::ActionExecutionInfo *info, QWidget *parent = 0)
~QtActionExecutionInfoDialog()
void setDetails(QString fv, QString fob, QString tv, QString tob)

Sets the item details text (‘from a/foo.jpg’, ‘to b/foo.jpg’). .

void setHead(QString txt)

Sets the header text. .

void setProgress(bool isDeterminate, quint64 done, quint64 all, QString text)

Sets the progress. .

int messageBox(QString text, QList<QString> answers, QString icon = QString(), int defaultanswer = -1, int cancelanswer = -1, QList<QString> answericons = QList<QString>())
int inputBox(QString text, QList<QString> answers, QString *value, QString icon = QString(), int defaultanswer = -1, int cancelanswer = -1, int valuePreselectFrom = -1, int valuePreselectTo = -1)
int multilineInputBox(QString text, QList<QString> answers, QString *value, QString icon = QString(), int defaultanswer = -1, int cancelanswer = -1)
int simpleChooserGridform(QString text, GridformEntries *entries, QStringList answers, int defaultanswer = -1, int cancelanswer = -1)
bool credentialsDialog(QString text, bool showDomain, bool showUsername, bool showPassword, bool showAnonymous, bool showRemember, QString *domain, QString *username, QString *password, bool *isAnonymous, bool *isRemember)
bool unixPermissionsDialog(bool *userMayRead, bool *userMayWrite, bool *userMayExecute, bool *groupMayRead, bool *groupMayWrite, bool *groupMayExecute, bool *othersMayRead, bool *othersMayWrite, bool *othersMayExecute, bool *sticky, bool *setuid, bool *setgid, QStringList users, QStringList groups, QString *ownerUser, QString *ownerGroup)
void setLogicallyVisible(bool v)

Sets if this dialog is logically visible (i.e. set visible by the action). .

void setBackground(bool v)

Sets if this dialog is currently in background mode (i.e. not visible). .

void setForceForeground(bool v)

Sets if this dialog is currently forced to be visible in foreground. .

bool isLogicallyVisible()

Returns if this dialog is logically visible (i.e. set visible by the action).

bool isBackground()

Returns if this dialog is currently in background mode (i.e. not visible).

QString simpleInputBox(QString text, QString deflt, int valuePreselectFrom = -1, int valuePreselectTo = -1)
int simpleMessageBox(QString text, int buttons = (int)MessageBoxButton::OK, QString icon = QString(), int defaultbutton = (MessageBoxButton)0, int cancelbutton = (MessageBoxButton)0)

Private Functions

void _computevisibility()

Private Members

Ui::QtActionExecutionInfoDialog *ui
sh::ui::qt::feedbackpanels::FeedbackPanel *currentFeedbackPanel = 0

Private Slots

void on_btnCancel_clicked()
void on_btnBackground_clicked()
class QtActionExecutionInfoPanel : public QWidget, public sh::ui::ActionExecutionInfoPanel
#include <qtactionexecutioninfopanel.h>

Qt status bar info-panel for an action execution.

Public Functions

QtActionExecutionInfoPanel(sh::actions::ActionExecutionInfo *info, QColor color, QWidget *parent = 0)
void setLabel(QString s)

Sets the label text. .

void setWidth(int width)

Sets the panel with (in pixels). .

QSize sizeHint() const
void setProgress(bool isProgressDeterminate, quint64 progressDone, quint64 progressAll)

Sets the progress. .

void setForceForeground(bool v)

Sets if the associated action is currently forced to be visible in foreground. .

void setPanelVisible(bool v)

Sets if the panel is visible. .

void onClicked(std::function<void()> fctQObject *owner = 0, )

Sets a handler for a click on the button (optionally bound to an owner lifetime).

void onDestroyed(std::function<void()> fctQObject *owner = 0, )

Sets a handler for panel removal (optionally bound to an owner lifetime).

void onVisibilityChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for panel visibility changes (optionally bound to an owner lifetime).

Private Functions

void _check_indeterminateanimationtimer_enable()

Private Members

QString lbl1
bool _progressDeterminate = false
int _indeterminateAnimationCounter = 0
int _width
QTimer *_indeterminateAnimationTimer
quint64 _progressAll
quint64 _progressDone
bool _isforeground_forced = false
sh::actions::ActionExecutionInfo *info
QPixmap gradient
QColor colorProgress2
QColor colorProgress1
QColor colorBase
QColor colorFrame
QColor colorText
QColor colorTextDark
class QtActionMenu : public QMenu
#include <qtactionmenu.h>

Qt based action menu used for context menus and in the toolbar.

Public Functions

QtActionMenu(QWidget *parent = 0)
void setHeader(QString t)
QList<QAction*> allActions()
void clearAllActions()
void removeActionAt(int i)
QAction *addNewAction(int i = -1)
QAction *addNewSubMenu(sh::ui::qt::QtActionMenu **qsubmenu, int i = -1)
QAction *addNewSeparator(int i = -1)
QAction *addNewHeader(int i = -1)
bool actionIsHeader(QAction *a)

Private Functions

void _observeAction(QAction *a)
void _correctMenuPosition()

Private Members

QColor brandingcolor
QFont _boldfont
QFont _normalfont
int _origMenuPosX = -1
int _origMenuPosY = -1
QString _header
int _cntInternalActions
class QtActionMenuHandler
#include <qtactionmenuhandler.h>

A handler which reflects the sh::actions objects to a graphical menu (and keeps that up-to-date).

Public Functions

QtActionMenuHandler(std::shared_ptr<sh::actions::ActionInstantiation> ai, std::shared_ptr<QtActionMenu> menu)

Private Functions

void _markDefault2()
void _append_actions(sh::ui::qt::QtActionMenu *menu, QList<std::shared_ptr<sh::actions::ActionInstantiation>> acts, std::shared_ptr<sh::actions::ActionCategory> category)

Private Members

QList<std::shared_ptr<sh::actions::ActionInstantiation>> selacts
QList<std::shared_ptr<sh::actions::ActionInstantiation>> diracts
QHash<QAction*, std::shared_ptr<sh::actions::AbstractActionItem>> qaction2action
std::weak_ptr<QtActionMenu> menu

Private Static Functions

std::shared_ptr<sh::actions::ActionActionItem> _getDefaultAction(QList<std::shared_ptr<sh::actions::AbstractActionItem>> actionList)
void _markDefault(std::weak_ptr<sh::actions::SubmenuActionItem> itmSubmenu, sh::ui::qt::QtActionMenu *menu)
QAction *_createAndConnectAction(sh::actions::AbstractActionItem *itm, sh::ui::qt::QtActionMenu *menu, std::function<void()> onchangedQObject *onchangedbuddy = 0, )
void _applyPropertiesToQAction(sh::actions::AbstractActionItem *itm, QAction *_widgetaction)
void _updateSubmenu(sh::actions::SubmenuActionItem *itm, QtActionMenu *menu, std::function<void()> onchanged = 0)

Friends

friend class QtToolbarButtonHandler
class QtDialog : public QDialog
#include <qtdialog.h>

Abstract base class for a qt based dialog. Typically used for also implementing some sh::ui::Dialog.

Subclassed by sh::ui::qt::QtAboutDialog, sh::ui::qt::QtExceptionDialog, sh::ui::qt::QtFilePropertyDialog, sh::ui::qt::QtLogViewDialog, sh::ui::qt::QtManageBookmarksDialog, sh::ui::qt::QtManageProfilesDialog, sh::ui::qt::QtOpenWithDialog, sh::ui::qt::QtStoreProfileDialog, sh::ui::qt::QtTuningDialog

Public Functions

QtDialog()
class QtDialogManager : public sh::ui::DialogManager
#include <qtdialog.h>

A DialogManager used in Qt ui.

Public Functions

std::shared_ptr<Dialog> getDialogById(qint64 id)

Returns a Dialog by dialog id.

Must be called in main thread.

QList<std::shared_ptr<Dialog>> getAllDialogs()

Returns a list of all dialogs currently shown (in order of creation).

Must be called in main thread.

QList<qint64> getAllDialogIds()

Returns a list of dialog ids of all dialogs currently shown (in order of creation).

Must be called in main thread.

template<class TDlg, typename ...Args>
std::shared_ptr<TDlg> createAndShowDialog(Args... args)

Creates and shows a Dialog by class and constructor parameters.

Those dialogs (TDlg) have to implement Dialog (typically a subclass of it, representing a particular dialog, like FilePropertyDialog), and also some ui mode (e.g. qt, web) specific class (depends on that ui mode).

You typically should not have to use it outside of MainWindow or subclasses. The MainWindow interface allows to create all available dialogs in a ui mode independent way.

May be called in any thread.

Return

The created Dialog instance.

Private Functions

void showDialog(std::shared_ptr<Dialog> dialog) override

This method implements the ui mode specific mechanism for showing a dialog.

Must be called in main thread.

class QtExceptionDialog : public sh::ui::qt::QtDialog, public sh::ui::ExceptionDialog
#include <qtexceptiondialog.h>

Qt based exception dialog.

Public Functions

QtExceptionDialog(QString error1, QString error2, QString details, QString icon, bool mayRetry, bool mayClose, bool mayCancel, bool showLoglabelAndDetails)
~QtExceptionDialog()
ExceptionDialogResult answer() override

Returns the answer the user has given in this dialog.

QString error1()

Returns the 1st error text.

QString error2()

Returns the 2nd error text.

QString details()

Returns the error details.

QString icon()

Returns the icon (as name resolveable by sh::base::IconManager).

bool mayRetry()

Returns if it’s allowed to retry.

bool mayClose()

Returns if it’s allowed to just close and continue without closing Shallot.

bool mayCancel()

Returns if it’s allowed to cancel, i.e. throwing a sh::exceptions::CancelException.

bool showLoglabelAndDetails()

Returns if the dialog shall allow to read the details.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Members

Ui::QtExceptionDialog *ui
ExceptionDialogResult _answer = ExceptionDialogResult::Shutdown

Private Slots

void on_btnExit_clicked()
void on_btnClose_clicked()
void on_btnCancel_clicked()
void on_btnRetry_clicked()
void on_btnShowLog_clicked()
void on_btnExitAndSaveLog_clicked()
void on_btnShowDetails_toggled(bool checked)
class QtFileDetailsPanel : public QWidget
#include <qtfiledetailspanel.h>

The details panel.

Can be shown in the main window. It presents detail information about the selected file.

Public Functions

QtFileDetailsPanel(QWidget *parent = 0)
void setNodes(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void setOrientation(Qt::Orientation orientation)
QSize sizeHint() const override
~QtFileDetailsPanel()

Private Members

int PADDINGX
int PADDINGY
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> _nodes
QList<std::shared_ptr<sh::paneldetails::PanelDetail>> _panelDetails
QList<DetailPlacement> _placements
QFont fontNormal
QFont fontBold
QPixmap _widgetimagecache
QTimer _widgetimagecachetimer
Qt::Orientation _orientation = Qt::Horizontal
class DetailPlacement
#include <qtfiledetailspanel.h>

Public Functions

DetailPlacement(int x, int y, int w, int h, QList<DetailRowPlacement> rowplacements, std::shared_ptr<sh::paneldetails::PanelDetail> detail)

Public Members

std::shared_ptr<sh::paneldetails::PanelDetail> detail
int x
int y
int w
int h
QList<DetailRowPlacement> rowplacements
class DetailRowPlacement
#include <qtfiledetailspanel.h>

Public Functions

DetailRowPlacement(int h, int contentx, int contenty, QList<int> elementwidths)
DetailRowPlacement() = default
DetailRowPlacement(const DetailRowPlacement&) = default

Public Members

int h
int contentx
int contenty
QList<int> elementwidths
class QtFileIconview : public QListView, public sh::ui::qt::QtFileView
#include <qtfileiconview.h>

Icon view for the contents of one directory.

Public Functions

QtFileIconview(QWidget *parent = 0)

Constructed only by the infrastructure and made available otherwise.

void setThumbDimension(double size)

Sets the size of the thumbnail image.

void setBackgroundColor(QString c)
QString backgroundColor()
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> selectedNodes()
void setSelection(const QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
std::shared_ptr<sh::filesystem::FilesystemNode> node()
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> getAllVisibleNodes()
void setSizeFormatting(sh::filesystem::SizeFormatting v)
void gotoDir(std::shared_ptr<sh::filesystem::FilesystemNode> n)
void setHiddenFilesVisible(bool value)
QThread *thread()
void configure(sh::ui::qt::QtFileViewControl *viewctrl)
void focus()
void setSort(int column, Qt::SortOrder order)
QObject *as_qobject()
QWidget *as_qwidget()
QAbstractItemView *as_qabstractitemview()
sh::ui::qt::QtFileViewControl *control()

Private Members

int _deleg_w = 0
int _deleg_h = 0
int _dsx = 0
int _dsy = 0
int _lineheight = 0
class QtFileList : public QTreeView, public sh::ui::qt::QtFileView
#include <qtfilelist.h>

List view for the contents of one directory.

Public Functions

QtFileList(QWidget *parent = 0)

Constructed only by the infrastructure and made available otherwise.

void setSort(int column, Qt::SortOrder order) override
void setBackgroundColor(QString c)
QString backgroundColor()
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> selectedNodes()
void setSelection(const QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
std::shared_ptr<sh::filesystem::FilesystemNode> node()
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> getAllVisibleNodes()
void setSizeFormatting(sh::filesystem::SizeFormatting v)
void gotoDir(std::shared_ptr<sh::filesystem::FilesystemNode> n)
void setHiddenFilesVisible(bool value)
QThread *thread()
void configure(sh::ui::qt::QtFileViewControl *viewctrl)
void focus()
QObject *as_qobject()
QWidget *as_qwidget()
QAbstractItemView *as_qabstractitemview()
sh::ui::qt::QtFileViewControl *control()

Private Functions

QString getColumnNameForIndex(int index)
void _adaptColumnWidth(int index)

Private Members

bool _skip_slot_sectionResized = false

Private Slots

void slot_sectionResized(int index, int oldsize, int newsize)

Private Static Attributes

std::shared_ptr<sh::configuration::ConfigurationValue> cfgvalFileListIconSize = sh::configuration::ConfigurationManager::instance()->registerConfigValue("sh::ui::qt::QtFileList.FileListIconSize", -1, sh::configuration::ConfigurationValue::valueTypeInteger(), QObject::tr("Icon size in file list panels"), sh::configuration::ConfigurationCategory::CategoryGUI, QString(), QObject::tr("For default size, set it to -1."))
class QtFilePropertyDialog : public sh::ui::qt::QtDialog, public sh::ui::FilePropertyDialog
#include <qtfilepropertydialog.h>

Qt based properties dialog.

Public Functions

~QtFilePropertyDialog()
QtFilePropertyDialog(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)

Constructed only by the infrastructure and made available otherwise.

void init(std::shared_ptr<Dialog> dialog) override

Executes custom stuff on initialization, e.g. for populating the dialog.

void refresh() override

Refreshes the dialog content.

sh::ui::FilePropertyDialogTabTableView *createTabViewTable() override

Creates a new tab view table sub-widget.

sh::ui::FilePropertyDialogTabTextView *createTabViewText() override

Creates a new tab view text sub-widget.

sh::ui::FilePropertyDialogTabIconTextBannerView *createTabViewIconTextBanner() override

Creates a new tab view icon text banner sub-widget.

QList<std::shared_ptr<FilePropertyDialogTab>> tabs()

Returns a list of all tabs.

sh::ui::FilePropertyDialogTabActionsView *widgetAt(std::shared_ptr<FilePropertyDialogTab> tab, int i)

Returns the widget from a tab at a certain index.

int widgetCount(std::shared_ptr<FilePropertyDialogTab> tab)

Returns the number of widgets in a tab.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Public Slots

void on_btnClose_clicked()
void on_btnRefresh_clicked()
void on_tabWidget_currentChanged(int index)
void selectTabByScrollPosition()

Public Static Functions

void addTabFactory(int i, std::shared_ptr<FilePropertyDialogTabFactory> factory)

Adds a FilePropertyDialogTabFactory so the Properties dialogs show its content.

See also the REGISTER_FILEPROPERTYDIALOGTAB macro.

Parameters
  • i: An index which controls the display order. Use one of the REGISTER_FILEPROPERTYDIALOGTAB_INDEX_* values in FilePropertyDialogTabFactory as base values.

Private Members

Ui::QtFilePropertyDialog *ui
QList<QWidget*> _internaltabwidgets
QList<QString> _tabheads
int _skip_on_tabWidget_currentChanged = 0
int _skip_selectTabByScrollPosition = 0
QVBoxLayout *scrollAreaLayout

Friends

friend class FilePropertyDialogTab
class QtFilePropertyDialogTabActionsView : public QWidget, public sh::ui::FilePropertyDialogTabActionsView
#include <qtfilepropertydialogtabactionsview.h>

A tab view which shows a main widget in the main part and some buttons below.

Public Functions

QtFilePropertyDialogTabActionsView(QWidget *parent = 0)

Is intended to be directly constructed from everywhere.

void setContent(FilePropertyDialogTabViewContent *w)

Sets the main widget. .

void setButtons(QList<QString> buttons)

Sets the list of buttons. .

void setVisible(bool v)

Sets the view visible or hidden. .

FilePropertyDialogTabViewContent *content()

The main widget.

QList<QString> buttons()

The list of buttons.

void onButtonTriggered(std::function<void(int i)> fct, QObject *owner = 0, )

Sets a handler for a click on one of the buttons (optionally bound to an owner lifetime).

class QtFilePropertyDialogTabIconTextBannerView : public QWidget, public sh::ui::FilePropertyDialogTabIconTextBannerView
#include <qtfilepropertydialogtabicontextbannerview.h>

Qt based FilePropertyDialogTabIconTextBannerView.

Public Functions

QtFilePropertyDialogTabIconTextBannerView(QWidget *parent = 0)
void clear()

Clears the contents.

void insertIcon(QIcon icon, int sizePt = 24)

Adds an icon.

void insertText(QString text)

Adds a text.

Private Members

QHBoxLayout *_layout
class QtFilePropertyDialogTabTableView : public QTableView, public sh::ui::FilePropertyDialogTabTableView
#include <qtfilepropertydialogtabtableview.h>

Qt based FilePropertyDialogTabTableView.

Public Types

typedef QPair<int, int> ItemIndex

Public Functions

QtFilePropertyDialogTabTableView(QWidget *parent = 0)
void setContent(QList<QPair<QString, QString>> content)

Sets the content.

QList<ItemIndex> getSelectedItems()

Returns the selected cells.

QVariant getItemValue(int r, int c)

Returns a value of a cell.

Private Functions

void createAndSetModel()
class QtFilePropertyDialogTabTextView : public QLabel, public sh::ui::FilePropertyDialogTabTextView
#include <qtfilepropertydialogtabtextview.h>

Qt based FilePropertyDialogTabTextView.

Public Functions

QtFilePropertyDialogTabTextView(QWidget *parent = 0)
void setContent(QString content)

Sets the content.

class QtFilesystemPanel : public QWidget
#include <qtfilesystempanel.h>

A splitted horizontal panel of file views.

Public Functions

QtFilesystemPanel(QWidget *parent = 0)
~QtFilesystemPanel()
void addView(bool reinitialize = false)
void removeView(int i)
sh::ui::FileView *currentView()
int currentViewIndex()
int viewsCount()
sh::ui::FileView *view(int i)
void selectFolder(std::shared_ptr<sh::filesystem::FilesystemNode> folder, int index = -1)
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> selectedNodes()
void _emit_viewmodeChanged(int i)
void buildView(std::shared_ptr<sh::ui::qt::QtFileView> *list, sh::ui::qt::QtFileViewControl *viewctrl, bool isNew)
void setCustomWidget(int i, std::shared_ptr<QWidget> w)
std::shared_ptr<sh::ui::qt::QtFileView> viewwidget(int i)

Signals

void panelFolderActivated(std::shared_ptr<sh::filesystem::FilesystemNode> folder, bool realSwitch)
void panelCurrentViewChanged()
void panelViewmodeChanged(int i)
void panelViewOptionChanged(int i)
void panelViewCountChanged()
void panelSelectionChanged()

Private Members

Ui::QtFilesystemPanel *ui
std::shared_ptr<sh::ui::qt::QtFileView> activeView
QString activeColor
QString inactiveColor
QList<std::shared_ptr<sh::ui::qt::QtFileView>> _views
QList<QWidget*> _mainviews
QHash<QWidget*, std::shared_ptr<QWidget>> _customwidgets
QList<sh::ui::qt::QtFileViewControl*> _viewcontrols
bool _skip_eventfilter = false

Friends

friend class ui::qt::QtMainWindow
friend class ui::FileView
class QtFileView : public std::enable_shared_from_this<QtFileView>
#include <qtfileview.h>

Abstract base class for views for the contents of one directory.

Subclassed by sh::ui::qt::QtFileIconview, sh::ui::qt::QtFileList

Public Functions

QtFileView()

Constructed only by the infrastructure and made available otherwise.

~QtFileView()
void setBackgroundColor(QString c)
QString backgroundColor()
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> selectedNodes()
void setSelection(const QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
std::shared_ptr<sh::filesystem::FilesystemNode> node()
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> getAllVisibleNodes()
void setSizeFormatting(sh::filesystem::SizeFormatting v)
void gotoDir(std::shared_ptr<sh::filesystem::FilesystemNode> n)
void setHiddenFilesVisible(bool value)
QThread *thread()
void configure(sh::ui::qt::QtFileViewControl *viewctrl)
void focus()
void setSort(int column, Qt::SortOrder order)
QObject *as_qobject()
QWidget *as_qwidget()
QAbstractItemView *as_qabstractitemview()
sh::ui::qt::QtFileViewControl *control()

Private Members

sh::ui::qt::QtFileViewControl *_viewctrl = nullptr
QString _tmp_bgColor
QPoint _dragStartPosition
int _async_gotodir_index = 0
bool _dragIsValid = false
int _sort_column = 0
Qt::SortOrder _sort_order = Qt::AscendingOrder

Friends

friend class sh::actions::common::ActionHistoryNavigateForward
friend class sh::actions::common::ActionHistoryNavigateBackward
friend class sh::actions::common::ActionNavigateInHistory
friend class sh::ui::qt::QtFileViewControl
class EventFilter : public QObject

Public Functions

EventFilter(QObject *parent, QtFileView *fileview, sh::ui::qt::QtFileViewControl *fileviewctrl)
bool eventFilter(QObject *object, QEvent *event)

Private Members

QtFileView *fileview
sh::ui::qt::QtFileViewControl *fileviewctrl
class QtFileViewControl : public sh::ui::FileView
#include <qtfileviewcontrol.h>

Qt based file view.

Public Functions

QtFileViewControl(sh::ui::qt::QtFilesystemPanel *panel, int i)
~QtFileViewControl()
sh::ui::ColumnDimensions *columndimensions() override

Returns the column dimensions handler. .

sh::tools::HistoryTracker<std::shared_ptr<const sh::filesystem::Eurl>> *historyTracker() override

Returns the history tracker. .

FileViewMode viewmode() override

Returns the view mode (icons, list, … ?). .

void setViewmode(FileViewMode m) override

Sets the view mode. .

int index() override

Returns the position of this file view within the panel. .

void gotoDir(std::shared_ptr<sh::filesystem::FilesystemNode> n) override

Jumps to a new current directory.

Implementations have to call the base class implementation inside.

sh::filesystem::SizeFormatting getSizeFormattingMode() override

Returns the mode how file sizes are formatted for displaying. .

void setSizeFormattingMode(sh::filesystem::SizeFormatting mode) override

Sets the mode how file sizes are formatted for displaying. .

bool hiddenFilesVisible() override

Returns if hidden files are visible. .

void setHiddenFilesVisible(bool v) override

Sets the visibility of hidden files. .

int iconDimension() override

Returns the icon size (in pixels). .

void setIconDimension(int v) override

Sets the icon size (in pixels). .

void setSort(int column, Qt::SortOrder order) override

Sets how to sort this view. .

int sortColumn() override

Returns the index of the current sort column. .

Qt::SortOrder sortOrder() override

Returns the current sort order. .

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> selectedNodes() override

Returns the nodes which the user has selected in this fileview. .

void setSelection(const QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) override

Sets the node selection of this fileview. .

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> getAllVisibleNodes() override

Returns a list of all nodes currently listed in this file view. .

void emit_nodesActivated(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void emit_selectionChanged()
std::shared_ptr<sh::filesystem::FilesystemNode> node()

Returns the current directory.

void reload(bool skipModel = false)

Reloads the data inside this file view.

sh::filesystem::FilesystemModelFileviewProxy *filemodel()

Returns the filesystem model for this view. .

void setFilemodel(sh::filesystem::FilesystemModelFileviewProxy *model)

Sets the filesystem model for this view. .

Signals

void nodesActivated(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void selectionChanged()

Triggered when the selection have changed.

void viewOptionChanged()

Triggered when some view options have changed.

Private Functions

void setIndex(int i)

Private Members

sh::ui::qt::QtFilesystemPanel *_panel
int i
sh::ui::ColumnDimensions *_columndimensions
sh::tools::HistoryTracker<std::shared_ptr<const sh::filesystem::Eurl>> *_historyTracker
FileViewMode _viewmode = FileViewMode::ListView
bool _hiddenfilesvisible = false
int _icondimension = 0
int _sortColumn
Qt::SortOrder _sortOrder
sh::filesystem::SizeFormatting _sizeformattingmode = sh::filesystem::SizeFormatting::SizeFormattingModePrefixes

Friends

friend class sh::ui::qt::QtFilesystemPanel
class QtJumpBar : public QWidget
#include <qtjumpbar.h>

Button bar for navigating to places with parent-buttons and an text entry.

Public Functions

QtJumpBar(QWidget *parent = 0)
~QtJumpBar()
void setButtonMode()
void setTextMode()
bool isTextMode()
std::shared_ptr<sh::filesystem::FilesystemNode> node()
void setNode(std::shared_ptr<sh::filesystem::FilesystemNode> node)
QSize sizeHint() const

Signals

void nodeChanged()
void eurlRequested(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Private Functions

void _buildButtons()

Private Members

std::shared_ptr<sh::filesystem::FilesystemNode> _node = 0
Ui::QtJumpBar *ui
bool _isTextMode

Private Slots

void on_btnOk_clicked()
void on_btnAbort_clicked()
class QtLinkButton : public QToolButton
#include <qtlinkbutton.h>

QToolButton with different look.

Subclassed by sh::ui::qt::QtSearchPanelButton

Public Functions

QtLinkButton(QWidget *parent = 0)
void setSizeByFactor(int f)
void setMenu(QStringList items, QString menuchangetxt = tr("(change)"))
void setSelectedMenuItem(int idx)

Signals

void menuItemSelected(int idx)

Private Members

QString _linkcolor
QStringList _menuitems
QString _menuchangetxt
class QtLogViewDialog : public sh::ui::qt::QtDialog, public sh::ui::LogViewDialog
#include <qtlogviewdialog.h>

Qt based log view dialog.

Public Functions

QtLogViewDialog(QString headtext, QString subheadtxt, base::LogSeverity minseverity)
~QtLogViewDialog()
QString headtext()

Returns the header text.

QString subheadtxt()

Returns the 2nd header text.

sh::base::LogSeverity minimumSeverity()

Returns the minimum severity.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Functions

void _reloadLog()
void setMinimumSeverity(sh::base::LogSeverity minseverity)

Private Members

Ui::QtLogViewDialog *ui

Private Slots

void on_btnClose_clicked()
void on_btnSaveToFile_clicked()
void on_btnSeverity_clicked()
class QtMainWindow : public QMainWindow, public sh::ui::MainWindow
#include <qtmainwindow.h>

The qt main window implementation.

Public Functions

QtMainWindow(QWidget *parent = 0)
~QtMainWindow()
void initialize() override

Initializes this main window. .

std::shared_ptr<DialogManager> dialogManager() override

Returns the DialogManager which creates and drives Dialogs for this main window.

You typically should not need to use it directly.

int fileViewCount() override

Returns the current number of file views. .

void addFileView(bool reinitialize = false) override

Adds a new file view. .

void removeFileView(int i) override

Removes a file view. .

sh::ui::FileView *currentFileView() override

Returns the file view which is currently active (i.e. focussed). .

sh::ui::FileView *getFileView(int i) override

Returns a file view by position index. .

void jumpToNode(std::shared_ptr<sh::filesystem::FilesystemNode> node) override

Let the current view jump to another location. .

void setTitlePattern(QString value) override

Sets the window title pattern. .

void setTreeVisible(bool v) override

Sets the visibility of the directory tree. .

void setFileDetailsPanelVisible(bool v) override

Sets the visibility of the file details panel. .

std::shared_ptr<sh::filesystem::FilesystemNode> currentDirectory() override

Gets the sh::filesystem::FilesystemNode selected in the current view. .

std::shared_ptr<sh::ui::ActionExecutionInfoPanel> addInfoPanel(int position, sh::actions::ActionExecutionInfo *info, QColor color = QColor()) override

Creates a new action execution panel.

Let this smart pointer die for removing it.

void jumpbarSetTextMode() override

Sets the jumpbar to text input mode. .

void jumpbarSetButtonMode() override

Sets the jumpbar to button mode. .

bool jumpbarIsTextMode() override

Returns if the jumpbar is in text input mode. .

QString toolbarPosition() override

Returns the current toolbar position. .

void setToolbarPosition(QString pos) override

Sets the toolbar position. .

QString detailPanelPosition() override

Returns the current detail panel position. .

void setDetailPanelPosition(QString pos) override

Sets the detail panel position. .

std::shared_ptr<AboutDialog> showAboutDialog() override

Shows and returns an ‘About’ dialog. .

std::shared_ptr<ManageProfilesDialog> showManageProfilesDialog() override

Shows and returns a ‘Manage Saved Settings’ dialog. .

std::shared_ptr<OpenWithDialog> showOpenWithDialog(std::shared_ptr<sh::filesystem::FilesystemNode> node, QList<std::shared_ptr<sh::tools::filetypes::OpenMethod>> openMethods) override

Shows and returns a ‘Open With’ dialog. .

std::shared_ptr<StoreProfileDialog> showStoreProfileDialog(std::shared_ptr<const sh::filesystem::Eurl> eurl) override

Shows and returns a ‘Save Settings’ dialog. .

std::shared_ptr<TuningDialog> showTuningDialog() override

Shows and returns a ‘Tuning’ dialog. .

std::shared_ptr<LogViewDialog> showLogViewDialog(QString headtext = QString(), QString subheadtxt = QString(), sh::base::LogSeverity minseverity = sh::base::LogSeverity::_DEFAULT) override

Shows and returns a ‘Log’ dialog. .

std::shared_ptr<ManageBookmarksDialog> showManageBookmarksDialog() override

Shows and returns a ‘Manage Bookmarks’ dialog. .

std::shared_ptr<FilePropertyDialog> showFilePropertyDialog(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) override

Shows and returns a ‘File Properties’ dialog. .

std::shared_ptr<ActionExecutionInfoDialog> createActionExecutionInfoDialog(sh::actions::ActionExecutionInfo *info) override

Creates an action execution dialog. .

void handleCloseAppRejected(QString rejectmsg) override

React on a rejected application close request (with some feedback message). .

void handleClosed() override

Do some cleanup steps just when closing starts. Implementations must call base implementation!

sh::ui::qt::QtUIStyle *uiStyle()

Gets a QtUIStyle instance, which helps for common ui styling.

void _initialize(sh::base::SingletonInitializer *singletonInitializer)

Initializes the main window. For custom initialization logic, see MainWindow.initialize. .

void fileViewsReloadAll()

Reload all content in each file view.

void onFileViewOptionsChanged(std::function<void(int)> fct, QObject *owner = 0, )

Sets a handler for some view options in a file view changed (optionally bound to an owner lifetime).

void onCurrentFileViewChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for the currently active file view changed (optionally bound to an owner lifetime).

void onFileViewCountChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for the number of file views changed (optionally bound to an owner lifetime).

void onCurrentDirectoryChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for the current directory in the active file view changed (optionally bound to an owner lifetime).

void onGlobalViewOptionsChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for some global view options changed (optionally bound to an owner lifetime).

void onCurrentProfileChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for the current profile changed (optionally bound to an owner lifetime).

void jumpToEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Let the current view jump to another location. .

QString titlePattern()

Returns the window title pattern.

void setCurrentProfile(QString profile)

Sets the current profile. .

QString currentProfile()

Returns the current profile.

void reloadProfile()

Reloads the profile data.

bool treeVisible()

Returns the visibility of the directory tree.

void setTreeSticky(bool v)

Sets if the directory tree should follow the active file view. .

bool treeSticky()

Returns if the directory tree follows the active file view.

bool fileDetailsPanelVisible()

Returns the visibility of the file details panel.

std::shared_ptr<sh::ui::ActionExecutionInfoPanel> addInfoPanel(sh::actions::ActionExecutionInfo *info, QColor color = QColor())

Creates a new action execution panel.

Let this smart pointer die for removing it.

std::shared_ptr<ActionExecutionInfoPanel> showErrorPanel()

Shows an error panel.

void _closeDirectly()

Directly begin application shutdown without checks.

bool closeApp()

Check if the application may shut down now, and if so, initiate it.

bool isCloseable(QString *msg = nullptr)

Check if the application may shut down now.

bool isClosing()

Returns if the application is currently closing.

Public Static Functions

bool tryCreateMainWindow(MainWindow *&mainWindow)
QtMainWindow *mainWindow()
void setMainWindow(MainWindow *mainWindow)

Sets the main window instance. .

bool isReady()

Returns if this process ui is ready (i.e. is created or runs headless).

bool runsHeadless()

Returns if this process runs headless, i.e. without any ui, just for a background process.

void _closeDirectly(sh::base::SingletonInitializer *singletonInitializer)
QString uiMode()

Returns the UI mode (e.g. qt, web).

Private Functions

void _setupGlobalShortcut(std::shared_ptr<sh::actions::AbstractActionItem> action)
void _setupGlobalShortcut_recursive(std::shared_ptr<sh::actions::SubmenuActionItem> submenu)
void _addPermanentActionToToolbar(std::shared_ptr<sh::actions::SubmenuActionItem> a, bool rightSide = false, bool preventDefaultAction = false)
void _refreshToolbar(std::shared_ptr<sh::actions::ActionInstantiation>)
void _jumpToNode(std::shared_ptr<sh::filesystem::FilesystemNode> node, int skip)
void _jumpToIndex(QModelIndex idx, int skip)
void _newToStatusbar_helper(sh::ui::qt::QtActionExecutionInfoPanel *w)
void _refresh_detailthumbnailvisibility()
void _thumbnail_resized()
void _resizethumbnail()
void _detailpanel_resized()
void _resizedetailpanel()
void requestDetailThumbnail(bool force = true)
void setStatusBarVisibility(bool v)

Private Members

Ui::QtMainWindow *ui
sh::ui::qt::QtFilesystemPanel *fspanel
sh::filesystem::FilesystemModelDirectoryTreeProxy *treemodel = 0
sh::ui::qt::QtJumpBar *jumpbar
QTimer _statusbar_timer
int _statusbar_fullheight
int _statusbar_targetheight = 0
QSet<sh::ui::qt::QtActionExecutionInfoPanel*> _statusbar_childs
std::shared_ptr<sh::filesystem::FilesystemNode> _currentDirectory = 0
bool _request_detailthumbnail_skip = false
int _thumbnailwidth = 0
Qt::Orientation _myorientation = Qt::Horizontal
sh::ui::qt::QtUIStyle *_uistyle = 0
QAction *_toolbarLeftRightSplitSeparator
QHash<QString, std::shared_ptr<sh::actions::common::ActionGroups>> actionGroupsActions
QList<QtToolbarButtonHandler*> toolbarButtonHandlers
std::shared_ptr<QtDialogManager> _dialogManager

Private Slots

void slot_detailbar_moved()
void slot_toolbar_moved()
void slot_statusbartimer()
void slot_treeview_collapsedexpanded(const QModelIndex &index)

Private Static Attributes

QtMainWindow *_qtMainWindow = nullptr

Friends

friend class QtToolbarButton
friend class QtFilesystemPanel
class MyFlexibleLabel : public QLabel
#include <qtmainwindow.h>

Needed internally in main window in order to have a label which really does not request any sizes.

Public Functions

MyFlexibleLabel(QWidget *parent = 0)
QSize sizeHint() const override
class QtManageBookmarksDialog : public sh::ui::qt::QtDialog, public sh::ui::ManageBookmarksDialog
#include <qtmanagebookmarksdialog.h>

Qt based manage bookmarks dialog.

Public Functions

QtManageBookmarksDialog()
~QtManageBookmarksDialog()
qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Functions

void readBookmarks()
void _refresh_values()
void _selectbookmark(QString id)
void _selectfolder(QStringList name)

Private Members

Ui::QtManageBookmarksDialog *ui

Private Slots

void on_btnClose_clicked()
void on_treeWidget_itemSelectionChanged()
void on_btnDelete_clicked()
void on_edtLabel_textChanged(const QString &arg1)
void on_edtLocation_textChanged(const QString &arg1)
void on_btnStore_clicked()
void on_btnNew_clicked()
void on_btnUp_clicked()
void on_btnDown_clicked()
void on_btnMove_clicked()
class QtManageProfilesDialog : public sh::ui::qt::QtDialog, public sh::ui::ManageProfilesDialog
#include <qtmanageprofilesdialog.h>

Qt based manage saved settings dialog.

Public Functions

QtManageProfilesDialog()
~QtManageProfilesDialog()
qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Functions

void _createProfileList()
void _createSettingsList()
void _createNodesList()

Private Members

Ui::QtManageProfilesDialog *ui
QStringListModel *_model
sh::settings::ProfileNode *_currentNode = 0
QHash<QListWidgetItem*, QString> _nodes

Private Slots

void on_comboBox_currentTextChanged(const QString &arg1)
void on_btnClose_clicked()
void on_btnDelNode_clicked()
void on_btnDelProfile_clicked()
void slot_listViewactivated(QListWidgetItem*, QListWidgetItem*)
class QtOpenWithDialog : public sh::ui::qt::QtDialog, public sh::ui::OpenWithDialog
#include <qtopenwithdialog.h>

Qt based open with dialog.

Public Functions

QtOpenWithDialog(std::shared_ptr<sh::filesystem::FilesystemNode> node, QList<std::shared_ptr<sh::tools::filetypes::OpenMethod>> openMethods)
~QtOpenWithDialog()
void setProgramList(QList<std::shared_ptr<sh::tools::filetypes::OpenMethod>> openMethods)
std::shared_ptr<sh::tools::filetypes::OpenMethod> chosenMethod() override

Returns the chosen open-method (program for opening the file).

bool rememberForMimetype() override

Returns if the chosen method is checked to be remembered for the same mime-type in the future.

std::shared_ptr<const sh::filesystem::Eurl> rememberForDirectory() override

If it’s checked for the chosen method to be remembered for some subdirectory in the future, it returns the Eurl of this subdirectory, otherwise nullptr.

bool rememberForFile() override

Returns if the chosen method is checked to be remembered for the same file in the future.

std::shared_ptr<sh::filesystem::FilesystemNode> node()

Returns the file node which is later to be opened.

QList<std::shared_ptr<tools::filetypes::OpenMethod>> openMethods()

Returns the open-methods (programs for opening the file) to present for choice.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Members

std::shared_ptr<sh::tools::filetypes::OpenMethod> _chosenMethod
std::shared_ptr<const sh::filesystem::Eurl> _rememberfordirectory
QAbstractItemModel *_listmodel
Ui::QtOpenWithDialog *ui

Private Slots

void on_btnCancel_clicked()
void on_btnOk_clicked()
void on_btnSelectOther_clicked()
void on_listView_activated(const QModelIndex &index)
void on_btnAnotherAncestor_clicked()
void on_chkRememberDir_toggled(bool checked)
class QtOpenWithDialogModel : public QStringListModel
#include <qtopenwithdialog.h>

Used internally in OpenWithDialogModel.

Public Functions

QtOpenWithDialogModel(QList<std::shared_ptr<sh::tools::filetypes::OpenMethod>> methods, QObject *parent = 0)
QVariant data(const QModelIndex &index, int role) const

Private Members

QList<std::shared_ptr<sh::tools::filetypes::OpenMethod>> _methods
class QtSearchPanel : public QWidget
#include <qtsearchpanel.h>

Search panel for usage in the Qt main window.

Public Functions

QtSearchPanel(std::shared_ptr<sh::filesystem::FilesystemNode> node, QWidget *parent = 0)
~QtSearchPanel()

Friends

friend class QtSearchPanelConfiguration
template<class T1, class T2>
class QtSearchPanelAbstractEditor : public T1, public T2
#include <qtsearchpanelconfiguration.h>

Helper for other Qt based search panel editors.

Public Functions

QtSearchPanelAbstractEditor(QWidget *parent = 0)
bool isWidgetEnabled()
void setWidgetEnabled(bool v)
class QtSearchPanelButton : public sh::ui::qt::QtLinkButton, public sh::ui::SearchPanelButton
#include <qtsearchpanelconfiguration.h>

Qt based SearchPanelButton.

Public Functions

QtSearchPanelButton(QWidget *parent = 0)
void setButtonText(QString txt)

Sets the button text. .

void setMenuSelection(int i)

Sets the currently selected menu item (for buttons with menus). .

void setSizeByFactor(int f)
void setMenu(QStringList items, QString menuchangetxt = tr("(change)"))
void setSelectedMenuItem(int idx)

Signals

void menuItemSelected(int idx)
class QtSearchPanelConfiguration : public sh::ui::SearchPanelConfiguration
#include <qtsearchpanelconfiguration.h>

Search panel configuration for usage in a Qt ui.

Public Functions

QtSearchPanelConfiguration(QtSearchPanel *owner, QHBoxLayout *editors)
SearchPanelButton *addMenuButton(QString text, QStringList menu, std::function<void(int)> onchanged)

Adds and returns a button for a menu. .

SearchPanelButton *addActionButton(QString text, std::function<void()> action)

Adds and returns a button for an action. .

SearchPanelTextEditor *addTextEditor()

Adds and returns a text editor. .

SearchPanelDateTimeEditor *addDateTimeEditor()

Adds and returns a date/time editor. .

SearchPanelLabelEditor *addLabel()

Adds and returns a label. .

SearchPanelSpacerEditor *addSpacer()

Adds and returns a spacer. .

SearchPanelAbstractEditor *getEditorAt(int i)

Returns the editor widget at a given position. .

void onDestroyed(std::function<void()> fctQObject *owner = 0, )

Sets a handler for panel removal (optionally bound to an owner lifetime).

Public Members

_SearchPanelConfiguration_HelperQObject myqobject

Private Members

QtSearchPanel *owner
QHBoxLayout *editors
class QtSearchPanelDateTimeEditor : public sh::ui::qt::QtSearchPanelAbstractEditor<QDateTimeEdit, SearchPanelDateTimeEditor>
#include <qtsearchpanelconfiguration.h>

Qt based SearchPanelDateTimeEditor.

Public Functions

QtSearchPanelDateTimeEditor(QWidget *parent = 0)
QDateTime datetime()

Returns the selected date/time. .

void setDatetime(QDateTime s)

Sets the selected date/time.

bool isWidgetEnabled()
void setWidgetEnabled(bool v)
class QtSearchPanelLabelEditor : public sh::ui::qt::QtSearchPanelAbstractEditor<QLabel, sh::ui::SearchPanelLabelEditor>
#include <qtsearchpanelconfiguration.h>

Qt based SearchPanelLabelEditor.

Public Functions

QtSearchPanelLabelEditor(QWidget *parent = 0)
QString textContent()

Returns the text content. .

void setTextContent(QString s)

Sets the text content. .

SearchPanelAbstractEditor *focusProxyEditor()

Returns the focus proxy widget (which focus gets redirected to in some situations). .

void setFocusProxyEditor(SearchPanelAbstractEditor *w)

Sets the focus proxy widget (which focus gets redirected to in some situations). .

bool isWidgetEnabled()
void setWidgetEnabled(bool v)
class QtSearchPanelSpacerEditor : public sh::ui::qt::QtSearchPanelAbstractEditor<QLabel, sh::ui::SearchPanelSpacerEditor>
#include <qtsearchpanelconfiguration.h>

Qt based SearchPanelSpacerEditor.

Public Functions

QtSearchPanelSpacerEditor(QWidget *parent = 0)
bool isWidgetEnabled()
void setWidgetEnabled(bool v)
class QtSearchPanelTextEditor : public sh::ui::qt::QtSearchPanelAbstractEditor<QLineEdit, sh::ui::SearchPanelTextEditor>
#include <qtsearchpanelconfiguration.h>

Qt based SearchPanelTextEditor.

Public Functions

QtSearchPanelTextEditor(QWidget *parent = 0)
QString textContent()

Returns the text content. .

void setTextContent(QString s)

Sets the text content. .

QString placeholderDescription()

Returns the placeholder description text (visible if field is empty). .

void setPlaceholderDescription(QString s)

Sets the placeholder description text (visible if field is empty). .

bool isWidgetEnabled()
void setWidgetEnabled(bool v)
class QtSettingUIFrame : public QFrame
#include <qtsettinguiframe.h>

User interface for one handling one setting.

Public Functions

QtSettingUIFrame(sh::settings::Setting *setting, bool withcheckbox, QString displayvalue, QString additionalCheck, QVariant additionalCheckValue, QWidget *parent = 0)
bool isChecked()
void setChecked(bool val)
void setAdditionalCheckVisible(bool v)
QVariant additionalCheckValue()

Private Members

QCheckBox *_checkbox = 0
QCheckBox *_additionalcheckbox = 0
QLabel *_additionalcheckboxlabel = 0
QWidget *_additionalcheckwidget = 0
QVariant _additionalCheckValue
class QtStoreProfileDialog : public sh::ui::qt::QtDialog, public sh::ui::StoreProfileDialog
#include <qtstoreprofiledialog.h>

Qt based save settings dialog.

Public Functions

QtStoreProfileDialog(std::shared_ptr<const sh::filesystem::Eurl> eurl)
~QtStoreProfileDialog()
QList<sh::ui::StoreProfileDialog::SettingEntry> checkedSettings() override

Returns the list of settings the user has checked to store.

QString profileName() override

Returns the profile the user has chosen to store settings for.

bool withSubDirectories() override

Returns if the user has chosen to apply the checked settings also for subdirectories.

QStringList inheritsFrom() override

Returns the list of profiles the user has chosen to inherit from.

bool hasGlobal() override

Returns if the user has chosen to apply the checked settings for each directory (instead of the current directory).

std::shared_ptr<const sh::filesystem::Eurl> eurl()

Returns the current directory this dialog shall work on.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Functions

void _settingsLevel(int level, bool persist = true)
void _setglobal(bool v)

Private Members

QHash<sh::ui::qt::QtSettingUIFrame*, std::shared_ptr<sh::settings::Setting>> _widgets
QHash<int, QLabel*> _headerlabels
QStringList _inheritProfileNameList
bool _global = false
Ui::QtStoreProfileDialog *ui
int _level

Private Slots

void on_btnAddProf_clicked()
void on_btnGlobal_clicked()
void on_btn22_clicked()
void on_toolButton_2_clicked()
void on_toolButton_clicked()
class QtToolbarButton : public QToolButton
#include <qttoolbarbutton.h>

A qt toolbar button implementation with optional submenu.

Public Types

enum Position

Values:

enumerator LEFT
enumerator RIGHT
enumerator TOP
enumerator BOTTOM

Public Functions

QtToolbarButton(QWidget *parent = 0)
void setText(const QString &text)
QString text() const
void setIcon(const QIcon &icon)
QIcon icon()
QSize sizeHint() const
void setButtonText(QString v)
QString buttonText()
void setButtonIcon(QIcon v)
QIcon buttonIcon()
void setButtonEnabled(bool v)
bool isButtonEnabled()
bool hasExpander()
void setSubmenu(QtActionMenu *menu)
QtActionMenu *submenu()
void setLocation(Position location)
void setClickAction(std::function<void()> action)
void unsetClickAction()
void trigger()
void openMenu()

Private Functions

void _calcDims()
void computeArrowAndDividerLineCoordinates()

Private Members

QString _text
QString _text1
QString _textWithoutMnemonic1
QString _text2
QString _textWithoutMnemonic2
QIcon _icon
bool _drawIconOnly = false
bool _hovered = false
bool _arrowhovered = false
sh::ui::qt::QtActionMenu *_menu = 0
std::function<void()> _clickAction
Position location
int tw1
int tworig1
int tw2
int tworig2
int twmax
int tworigmax
int th
int thorig
int iw
int ih
int iedim
int ew
int eh
const int textpad = 20
const int opad = 3
int expx1
int expx2
int expy1
int expy2
int xt
int yt1
int yt2
int xi
int yi
QPainterPath arrow
bool _drawmnemonics = false

Private Slots

void slot_clicked()

Friends

friend class sh::actions::ActionsManager
class QtToolbarButtonHandler
#include <qttoolbarbuttonhandler.h>

A handler which reflects the sh::actions objects to a graphical toolbar button (and keeps that up-to-date).

Public Functions

QtToolbarButtonHandler(std::shared_ptr<sh::actions::SubmenuActionItem> action, bool preventDefaultAction, QtToolbarButton *button, QAction *qaction)
~QtToolbarButtonHandler()

Private Functions

void _updateSubmenu()

Private Members

std::shared_ptr<sh::actions::SubmenuActionItem> action
QtActionMenu menu
bool preventDefaultAction
QtToolbarButton *button

Private Static Functions

void _applyPropertiesToButton(sh::actions::SubmenuActionItem *action, QtToolbarButton *button, QAction *qaction)
class QtTuningDialog : public sh::ui::qt::QtDialog, public sh::ui::TuningDialog
#include <qttuningdialog.h>

Qt based tuning dialog.

Public Functions

QtTuningDialog()
~QtTuningDialog()
qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Types

typedef QPair<QString, QWidget*> BoxWidgetByDesc

Private Functions

QString _changedlglabel(std::shared_ptr<sh::configuration::ConfigurationValue> cv)
void do_change(std::shared_ptr<sh::configuration::ConfigurationValue> cv)
void filterVisibility(QString s)

Private Members

Ui::QtTuningDialog *ui
QList<BoxWidgetByDesc> boxWidgetsByDesc

Private Slots

void on_btnCancel_clicked()
void on_lineEditSearchInt_textChanged(const QString &arg1)
void on_lineEditSearchExt_textChanged(const QString &arg1)
void on_lineEditSearchBehav_textChanged(const QString &arg1)
void on_lineEditSearchAppear_textChanged(const QString &arg1)
void on_tabWidget_currentChanged(int index)
class QtUIStyle
#include <qtuistyle.h>

Methods for applying the Shallot visible style.

See sh::ui::qt::QtMainWindow about how to get an instance.

Public Functions

QtUIStyle(sh::ui::qt::QtMainWindow *mainwnd)

Constructed only by the infrastructure and made available otherwise.

QColor windowColor()
QColor backgroundColor()
QColor inactiveBackgroundColor()
QColor windowColorHighlighted()
QColor windowColorHalfHighlighted()
QColor windowColorDarkened()
QColor windowColorLikeTitlebar()
QColor linkColor()
QColor titlebarColor()
QColor foregroundColor()
QColor foregroundColorLighter1()
QColor foregroundColorLighter2()
int fontSizeInPt(int r = 100)
QColor mix(float n1, QColor c1, QColor c2)
Sheet createSheet()

Private Members

sh::ui::qt::QtMainWindow *_mainWindow
class Sheet
#include <qtuistyle.h>

Public Functions

QString sheet()
Sheet customcss(QString css)
Sheet fontsize_byFactor(int f)
Sheet fontsize_header()
Sheet fontsize_smaller()
Sheet textcolor(QColor color)
Sheet textcolor_lighter1()
Sheet textcolor_lighter2()
Sheet background(QColor color, bool restrictQWidget = true)
Sheet background_highlighted(bool restrictQWidget = true)
Sheet background_halfhighlighted(bool restrictQWidget = true)
Sheet background_darkened(bool restrictQWidget = true)
Sheet background_liketitlebar(bool restrictQWidget = true)
Sheet applyTo(QWidget *widget)
Sheet bold()

Private Functions

Sheet(QtUIStyle *style, QString sheet)

Private Members

QString _sheet
QtUIStyle *_style

Friends

friend class QtUIStyle
namespace feedbackpanels

Qt user interface parts for user feedback in action execution dialogs.

Implementations of sh::ui::qt::feedbackpanels::FeedbackPanel are used for implementing parts of sh::ui::ActionExecutionInfoDialog.

Typedefs

typedef QPair<QString, QWidget*> GridFormRow
class Credentials : public sh::ui::qt::feedbackpanels::FeedbackPanel
#include <credentials.h>

FeedbackPanel for user login credentials (password based).

Public Functions

Credentials(QString domain, QString username, QString password, QString text, bool showDomain, bool showUsername, bool showPassword, bool showAnonymous, bool showRemember)
~Credentials()
void cancelRequested()
bool isClosed()
void waitUntilClosed()
int preferredHeight()

Public Members

QString domain
QString username
QString password
bool anonymous
bool remember
bool accepted

Signals

void wasClosed()

Private Members

Ui::Credentials *ui

Private Slots

void on_chkAnonymous_toggled(bool checked)
void on_pushButton_3_clicked()
void on_pushButton_4_clicked()
class FeedbackPanel : public QWidget
#include <feedbackpanel.h>

Abstract base class for a Qt helper widget used in action user feedback.

Subclassed by sh::ui::qt::feedbackpanels::Credentials, sh::ui::qt::feedbackpanels::GridForm, sh::ui::qt::feedbackpanels::MsgBox, sh::ui::qt::feedbackpanels::UnixPermissions

Public Functions

FeedbackPanel(QWidget *parent = 0)
bool isClosed()
void waitUntilClosed()
int preferredHeight()
void cancelRequested() = 0

Signals

void wasClosed()

Private Members

QMutex _mutex
QWaitCondition _closedcondition
bool _closed = false
class GridForm : public sh::ui::qt::feedbackpanels::FeedbackPanel
#include <gridform.h>

FeedbackPanel for grid based forms.

Public Functions

GridForm(QString text, QList<sh::ui::qt::feedbackpanels::GridFormRow> form, QStringList answers, int defaultanswer = -1, int cancelanswer = -1, QWidget *parent = 0)
~GridForm()
int preferredHeight()
void cancelRequested()
bool isClosed()
void waitUntilClosed()

Public Members

int answer = -1

Signals

void wasClosed()

Private Members

Ui::GridForm *ui
QHash<QPushButton*, int> btn2index
QPushButton *_cancelBtn = 0
QPushButton *_defaultBtn = 0

Private Slots

void slot_btnclicked()
class GridFormInnerSimpleChooser : public QWidget
#include <gridforminnersimplechooser.h>

Helper widget for a GridForm.

Public Functions

GridFormInnerSimpleChooser(sh::actions::ActionExecutionUserFeedback::Choices *choices, QWidget *parent = 0)
~GridFormInnerSimpleChooser()

Public Members

int answer = -1
QString text

Private Functions

bool eventFilter(QObject *obj, QEvent *event)

Private Members

QLineEdit *lineedit
sh::actions::ActionExecutionUserFeedback::Choices *choices
QVBoxLayout *mylayout
sh::actions::ActionExecutionUserFeedback::Choice *currentchoice = 0

Private Slots

void slot_chosen(int id)
void slot_textedited(QString t)
class MsgBox : public sh::ui::qt::feedbackpanels::FeedbackPanel
#include <msgbox.h>

FeedbackPanel for showing a message, some answer buttons, and optionally a text input box.

Public Functions

MsgBox(QString question, QList<QString> answers, QString icon = "", QString withInputBox = QString(), bool inputBoxMultiline = false, int defaultanswer = -1, int cancelanswer = -1, int valuePreselectFrom = -1, int valuePreselectTo = -1, QList<QString> answericons = QList<QString>(), QWidget *parent = 0)
~MsgBox()
void cancelRequested()
bool isClosed()
void waitUntilClosed()

Public Members

int answer = -1
QString text

Signals

void wasClosed()

Private Members

Ui::MsgBox *ui
QHash<QPushButton*, int> btn2index
QWidget *_initialFocusWidget = 0
QPushButton *_cancelBtn = 0
QPushButton *_defaultBtn = 0
bool _inputBoxMultiline
int _valuePreselectFrom
int _valuePreselectTo

Private Slots

void slot_btnclicked()
class UnixPermissions : public sh::ui::qt::feedbackpanels::FeedbackPanel
#include <unixpermissions.h>

FeedbackPanel for setting one set of unix filesystem permissions.

Public Functions

UnixPermissions(QWidget *parent = 0)
~UnixPermissions()
void cancelRequested()
void setflags(bool userMayRead, bool userMayWrite, bool userMayExecute, bool groupMayRead, bool groupMayWrite, bool groupMayExecute, bool othersMayRead, bool othersMayWrite, bool othersMayExecute, bool sticky, bool setuid, bool setgid)
void setusers(QStringList users, QString selecteduser)
void setgroups(QStringList groups, QString selectedgroup)
bool isClosed()
void waitUntilClosed()
int preferredHeight()

Public Members

bool accepted
bool userMayRead
bool userMayWrite
bool userMayExecute
bool groupMayRead
bool groupMayWrite
bool groupMayExecute
bool othersMayRead
bool othersMayWrite
bool othersMayExecute
bool sticky
bool setuid
bool setgid
QString user
QString group

Signals

void wasClosed()

Private Members

Ui::UnixPermissions *ui

Private Slots

void on_pushButton_clicked()
void on_pushButton_2_clicked()
namespace web

The web user interface implementation.

This optional UI provides an application running in a web browser.

Typedefs

typedef QPair<QIcon, int> WebIconTextBannerItemIcon
typedef QPair<WebIconTextBannerItemIcon, QString> WebIconTextBannerItem
typedef QMap<QString, QString> WebCommandData
class WebAboutDialog : public QObject, public sh::ui::web::WebDialog, public sh::ui::AboutDialog
#include <webaboutdialog.h>

Web based about dialog.

Public Functions

WebAboutDialog()
QVariant dialogProperty(QString dlgPropertyKey, QVariant deflt = QVariant())

Returns a dialog property value by key.

void setDialogProperty(QString dlgPropertyKey, QVariant value)

Sets a dialog property value for a key.

QVariantHash dialogResult()

Returns the dialog result as hash.

The browser side of a web dialog can ‘accept’ a dialog while closing by setting a non-empty dialog result. This mechanism allows browser side dialogs to return data to the backend. It’s up to the backend to interpret the content of this hash.

If the dialog was cancelled, or is still open, the returned hash is empty. See also wasClosed().

void triggerDialogEvent(QString name, QJsonObject data = QJsonObject())

Triggers a dialog event (at the browsers).

They in turn typically fetch some data again in order to refresh the ui.

void setCloseableByUser(bool v = true)

Sets if this dialog shall be directly closeable by the user by the window decoration. Set to false if the user has to react on this dialog by clicking on some controls in the dialog body.

This method must be called during construction.

bool isCloseableByUser()

Returns if this dialog shall be directly closeable by the user by the window decoration.

QJsonObject toJson() override

Returns the json respesentation as QJsonObject.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

class WebActionExecutionInfoDialog : public sh::ui::ActionExecutionInfoDialog
#include <webactionexecutioninfodialog.h>

Web based action execution dialog.

Public Types

enum MessageBoxButton

Buttons in a message box from ActionExecutionUserFeedback.

Values:

enumerator NONE = 0
enumerator OK = 1 << 0
enumerator Continue = 1 << 1
enumerator Cancel = 1 << 2
enumerator Retry = 1 << 3
enumerator Yes = 1 << 4
enumerator No = 1 << 5

Public Functions

WebActionExecutionInfoDialog(sh::actions::ActionExecutionInfo *info)
void setDetails(QString fv, QString fob, QString tv, QString tob)

Sets the item details text (‘from a/foo.jpg’, ‘to b/foo.jpg’). .

void setHead(QString txt)

Sets the header text. .

void setProgress(bool isDeterminate, quint64 done, quint64 all, QString text)

Sets the progress. .

int messageBox(QString text, QList<QString> answers, QString icon = QString(), int defaultanswer = -1, int cancelanswer = -1, QList<QString> answericons = QList<QString>())
int inputBox(QString text, QList<QString> answers, QString *value, QString icon = QString(), int defaultanswer = -1, int cancelanswer = -1, int valuePreselectFrom = -1, int valuePreselectTo = -1)
int multilineInputBox(QString text, QList<QString> answers, QString *value, QString icon = QString(), int defaultanswer = -1, int cancelanswer = -1)
int simpleChooserGridform(QString text, GridformEntries *entries, QStringList answers, int defaultanswer = -1, int cancelanswer = -1)
bool credentialsDialog(QString text, bool showDomain, bool showUsername, bool showPassword, bool showAnonymous, bool showRemember, QString *domain, QString *username, QString *password, bool *isAnonymous, bool *isRemember)
bool unixPermissionsDialog(bool *userMayRead, bool *userMayWrite, bool *userMayExecute, bool *groupMayRead, bool *groupMayWrite, bool *groupMayExecute, bool *othersMayRead, bool *othersMayWrite, bool *othersMayExecute, bool *sticky, bool *setuid, bool *setgid, QStringList users, QStringList groups, QString *ownerUser, QString *ownerGroup)
qint64 id()
qint64 webts_created()
QString details_fromverb()
QString details_fromobject()
QString details_toverb()
QString details_toobject()
QString head()
bool progress_isDeterminate()
quint64 progress_done()
quint64 progress_all()
QString progress_text()
QJsonValue userFeedbackAsJsonValue()
bool isLogicallyVisible()

Returns if this dialog is logically visible (i.e. set visible by the action).

void setLogicallyVisible(bool v)

Sets if this dialog is logically visible (i.e. set visible by the action). .

bool isBackground()

Returns if this dialog is currently in background mode (i.e. not visible).

void setBackground(bool v)

Sets if this dialog is currently in background mode (i.e. not visible). .

void setForceForeground(bool v)

Sets if this dialog is currently forced to be visible in foreground. .

QString simpleInputBox(QString text, QString deflt, int valuePreselectFrom = -1, int valuePreselectTo = -1)
int simpleMessageBox(QString text, int buttons = (int)MessageBoxButton::OK, QString icon = QString(), int defaultbutton = (MessageBoxButton)0, int cancelbutton = (MessageBoxButton)0)

Private Functions

void _handleUserFeedback(QString kind, std::shared_ptr<UserFeedback> userfeedback)
void _triggerChanged()

Private Members

qint64 _id
QString _details_fv
QString _details_fob
QString _details_tv
QString _details_tob
QString _head
bool _progress_isDeterminate
quint64 _progress_done
quint64 _progress_all
QString _progress_text
std::shared_ptr<UserFeedback> _currentUserFeedback = 0
QMutex _currentUserFeedbackMutex
QWaitCondition _currentUserFeedbackChangedCondition
qint64 _webts_created

Private Static Functions

QByteArray iconToBase64Src(QString icon, int sizeInPt)
QList<QVariant> iconsToBase64Srcs(QStringList icons, int sizeInPt)

Friends

friend class WebActionManager
class UserFeedback : public QMap<QString, QVariant>
#include <webactionexecutioninfodialog.h>

Public Members

qint64 id = -1
bool answered = false
class WebActionExecutionInfoPanel : public sh::ui::ActionExecutionInfoPanel
#include <webactionexecutioninfopanel.h>

Web based action execution info panel.

Public Functions

WebActionExecutionInfoPanel(sh::actions::ActionExecutionInfo *info, QColor color)
~WebActionExecutionInfoPanel()
void setLabel(QString s)

Sets the label text. .

void setProgress(bool isProgressDeterminate, quint64 progressDone, quint64 progressAll)

Sets the progress. .

void setForceForeground(bool v)

Sets if the associated action is currently forced to be visible in foreground. .

void setPanelVisible(bool v)

Sets if the panel is visible. .

void setWidth(int width)

Sets the panel with (in pixels). .

qint64 id()
QString label()
bool isProgressDeterminate()
quint64 progressDone()
quint64 progressAll()
bool forceForeground()
bool panelVisible()
int width()
QColor color()
sh::actions::ActionExecutionInfo *info()
void onClicked(std::function<void()> fctQObject *owner = 0, )

Sets a handler for a click on the button (optionally bound to an owner lifetime).

void onDestroyed(std::function<void()> fctQObject *owner = 0, )

Sets a handler for panel removal (optionally bound to an owner lifetime).

void onVisibilityChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for panel visibility changes (optionally bound to an owner lifetime).

Private Functions

void _triggerChanged()

Private Members

QColor _color
sh::actions::ActionExecutionInfo *_info
qint64 _id
QString _label
bool _isProgressDeterminate
quint64 _progressDone
quint64 _progressAll
bool _forceForeground
bool _panelVisible
int _width

Friends

friend class WebActionManager
class WebActionManager : public QObject, public sh::ui::web::WebModule
#include <webactionmanager.h>

Manages sh::actions::AbstractActionItem handling, e.g. showing them in the toolbar, executing them, and displaying their user interface.

Public Functions

WebActionManager()
void initialize()
std::shared_ptr<WebActionExecutionInfoPanel> addInfoPanel(int position, sh::actions::ActionExecutionInfo *info, QColor color = QColor())

Adds and returns a new action info panel.

std::shared_ptr<WebActionExecutionInfoDialog> addActionExecutionInfoDialog(sh::actions::ActionExecutionInfo *info)

Adds and returns a new action info dialog.

void refreshToolbar(std::shared_ptr<sh::actions::ActionInstantiation> instantiation)

Refreshes the main toolbar.

bool rootCommand(WebServerEngineRequest *request, QString webadapter)

Returns the root (‘index.html’) content. .

void setEngine(WebServerEngine *webserver)

Assigns this web module to a sh::ui::web::WebServerEngine. .

WebServerEngine *webserver()

Returns the sh::ui::web::WebServerEngine this web module is assigned to (may be nullptr).

Public Static Functions

bool executeCommand_byQObjectReflection(QObject *o, WebServerEngineRequest *request, QString command, QString justLeftside = QString())

Convenience function often used by executeCommand().

For a QObject, it searches there for a slot with the name cmd_{command}, with `’/’s replaced by’_’s (so, for the command”foo/get_bars”, it searches for slotcmd_foo_get_bars`). If it finds one, it gets executed (in a worker thread). The request is considered as handled, if so.

If there is such a slot, but with appended __M in name, it is called in main thread!

Return

If it handled (answered) the command.

Private Functions

bool executeCommand(WebServerEngineRequest *request, QString command) override

Executes command as requested by the browser, if responsible.

Read parameters, check if this module is responsible for answering, and then write an answer with request.

Implementations often use executeCommand_byQObjectReflection() for convenience.

Return

If it handled (answered) the command.

void _observeToolbarAction(sh::actions::AbstractActionItem *a)
std::shared_ptr<sh::actions::AbstractActionItem> resolveActionpath(QString sactionpath, QStringList *actionpath, QList<QPair<QString, std::shared_ptr<sh::actions::AbstractActionItem>>> *subactions)
void _triggerActionuiChanged()

Private Members

QList<WebActionExecutionInfoPanel*> _infopanels
QList<WebActionExecutionInfoDialog*> _infodialogs
QTimer _triggerActionuiChangedTimer
QTimer _triggerToolbarRefreshTimer
QMap<QString, std::shared_ptr<sh::actions::SubmenuActionItem>> _permanentToolbarActions

Private Slots

void cmd__answer_userfeedback__M(WebServerEngineRequest *request)
void cmd__execute(WebServerEngineRequest *request)
void cmd__get(WebServerEngineRequest *request)
void cmd__get_ui__M(WebServerEngineRequest *request)
void cmd__icon(WebServerEngineRequest *request)
void cmd__panel_clicked__M(WebServerEngineRequest *request)

Private Static Attributes

QRegularExpression reActionTextAccel

Friends

friend class WebActionExecutionInfoPanel
friend class WebActionExecutionInfoDialog
class WebDetailPanelManager : public QObject, public sh::ui::web::WebModule
#include <webdetailpanelmanager.h>

Manages the detail panel (typically in bottom part of main window).

Public Functions

WebDetailPanelManager()
void load(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)

Loads details for a given list of nodes (typically called after they get selected).

bool rootCommand(WebServerEngineRequest *request, QString webadapter)

Returns the root (‘index.html’) content. .

void setEngine(WebServerEngine *webserver)

Assigns this web module to a sh::ui::web::WebServerEngine. .

WebServerEngine *webserver()

Returns the sh::ui::web::WebServerEngine this web module is assigned to (may be nullptr).

Public Static Functions

bool executeCommand_byQObjectReflection(QObject *o, WebServerEngineRequest *request, QString command, QString justLeftside = QString())

Convenience function often used by executeCommand().

For a QObject, it searches there for a slot with the name cmd_{command}, with `’/’s replaced by’_’s (so, for the command”foo/get_bars”, it searches for slotcmd_foo_get_bars`). If it finds one, it gets executed (in a worker thread). The request is considered as handled, if so.

If there is such a slot, but with appended __M in name, it is called in main thread!

Return

If it handled (answered) the command.

Private Functions

bool executeCommand(WebServerEngineRequest *request, QString command) override

Executes command as requested by the browser, if responsible.

Read parameters, check if this module is responsible for answering, and then write an answer with request.

Implementations often use executeCommand_byQObjectReflection() for convenience.

Return

If it handled (answered) the command.

Private Members

QMutex _mutex
QList<std::shared_ptr<sh::paneldetails::PanelDetail>> _paneldetails
qint64 _webts_lastupdate

Private Slots

void cmd__get_details(WebServerEngineRequest *request)
void cmd__get_thumbnail(WebServerEngineRequest *request)
class WebDialog : public sh::tools::Jsonable
#include <webdialog.h>

Abstract base class for a web based dialog. Typically used for also implementing some sh::ui::Dialog.

A web dialog is a dialog window presented to the user on browser side. A web dialog implementation consists of a backend part (a subclass of WebDialog) and a browser side part (basically a subclass of shwebui.Dialog).

For implementing a web dialog, implement a subclass of WebDialog (which in turn will specify the browser side part) and sh::ui::Dialog. Create such dialogs by means of WebDialogManager.

Communicating values between backend and browser typically works by dialogProperty() and setDialogProperty(), also dialogResult() for the dialog result after closing.

Subclassed by sh::ui::web::WebAboutDialog, sh::ui::web::WebExceptionDialog, sh::ui::web::WebFilePropertyDialog, sh::ui::web::WebLogViewDialog, sh::ui::web::WebManageBookmarksDialog, sh::ui::web::WebManageProfilesDialog, sh::ui::web::WebOpenWithDialog, sh::ui::web::WebStoreProfileDialog, sh::ui::web::WebTuningDialog

Public Functions

WebDialog(QString dialogClassName)

See WebDialogManager.

Parameters
  • dialogClassName: The name of the shwebui.Dialog subclass which implements the web dialog on browser side.

QVariant dialogProperty(QString dlgPropertyKey, QVariant deflt = QVariant())

Returns a dialog property value by key.

void setDialogProperty(QString dlgPropertyKey, QVariant value)

Sets a dialog property value for a key.

QVariantHash dialogResult()

Returns the dialog result as hash.

The browser side of a web dialog can ‘accept’ a dialog while closing by setting a non-empty dialog result. This mechanism allows browser side dialogs to return data to the backend. It’s up to the backend to interpret the content of this hash.

If the dialog was cancelled, or is still open, the returned hash is empty. See also wasClosed().

void triggerDialogEvent(QString name, QJsonObject data = QJsonObject())

Triggers a dialog event (at the browsers).

They in turn typically fetch some data again in order to refresh the ui.

void setCloseableByUser(bool v = true)

Sets if this dialog shall be directly closeable by the user by the window decoration. Set to false if the user has to react on this dialog by clicking on some controls in the dialog body.

This method must be called during construction.

bool isCloseableByUser()

Returns if this dialog shall be directly closeable by the user by the window decoration.

~WebDialog()
QJsonObject toJson() override

Returns the json respesentation as QJsonObject.

Private Members

QVariantHash _properties
QString _dialogClassName
qint64 _webts_created

Friends

friend class WebDialogManager
class WebDialogManager : public QObject, public sh::ui::web::WebModule, public sh::ui::DialogManager
#include <webdialog.h>

A DialogManager used in Web ui.

Public Functions

WebDialogManager()
WebServerEngine *webserver()

Return the WebServerEngine hosting this dialog.

bool rootCommand(WebServerEngineRequest *request, QString webadapter)

Returns the root (‘index.html’) content. .

void setEngine(WebServerEngine *webserver)

Assigns this web module to a sh::ui::web::WebServerEngine. .

std::shared_ptr<Dialog> getDialogById(qint64 id)

Returns a Dialog by dialog id.

Must be called in main thread.

QList<std::shared_ptr<Dialog>> getAllDialogs()

Returns a list of all dialogs currently shown (in order of creation).

Must be called in main thread.

QList<qint64> getAllDialogIds()

Returns a list of dialog ids of all dialogs currently shown (in order of creation).

Must be called in main thread.

template<class TDlg, typename ...Args>
std::shared_ptr<TDlg> createAndShowDialog(Args... args)

Creates and shows a Dialog by class and constructor parameters.

Those dialogs (TDlg) have to implement Dialog (typically a subclass of it, representing a particular dialog, like FilePropertyDialog), and also some ui mode (e.g. qt, web) specific class (depends on that ui mode).

You typically should not have to use it outside of MainWindow or subclasses. The MainWindow interface allows to create all available dialogs in a ui mode independent way.

May be called in any thread.

Return

The created Dialog instance.

Public Static Functions

bool executeCommand_byQObjectReflection(QObject *o, WebServerEngineRequest *request, QString command, QString justLeftside = QString())

Convenience function often used by executeCommand().

For a QObject, it searches there for a slot with the name cmd_{command}, with `’/’s replaced by’_’s (so, for the command”foo/get_bars”, it searches for slotcmd_foo_get_bars`). If it finds one, it gets executed (in a worker thread). The request is considered as handled, if so.

If there is such a slot, but with appended __M in name, it is called in main thread!

Return

If it handled (answered) the command.

Private Functions

std::shared_ptr<Dialog> getDialogForRequest(WebServerEngineRequest *request)

Returns the WebDialog referred to the request (i.e. its dialogId parameter).

bool executeCommand(WebServerEngineRequest *request, QString command) override

Executes command as requested by the browser, if responsible.

Read parameters, check if this module is responsible for answering, and then write an answer with request.

Implementations often use executeCommand_byQObjectReflection() for convenience.

Return

If it handled (answered) the command.

void showDialog(std::shared_ptr<Dialog> dialog) override

This method implements the ui mode specific mechanism for showing a dialog.

Must be called in main thread.

Private Slots

void cmd__change_dialog_property__M(WebServerEngineRequest *request)
void cmd__closed_in_browser__M(WebServerEngineRequest *request)
void cmd__list__M(WebServerEngineRequest *request)
class WebExceptionDialog : public QObject, public sh::ui::web::WebDialog, public sh::ui::ExceptionDialog
#include <webexceptiondialog.h>

Web based exception dialog.

Public Functions

WebExceptionDialog(QString error1, QString error2, QString details, QString icon, bool mayRetry, bool mayClose, bool mayCancel, bool showLoglabelAndDetails)
ExceptionDialogResult answer() override

Returns the answer the user has given in this dialog.

QVariant dialogProperty(QString dlgPropertyKey, QVariant deflt = QVariant())

Returns a dialog property value by key.

void setDialogProperty(QString dlgPropertyKey, QVariant value)

Sets a dialog property value for a key.

QVariantHash dialogResult()

Returns the dialog result as hash.

The browser side of a web dialog can ‘accept’ a dialog while closing by setting a non-empty dialog result. This mechanism allows browser side dialogs to return data to the backend. It’s up to the backend to interpret the content of this hash.

If the dialog was cancelled, or is still open, the returned hash is empty. See also wasClosed().

void triggerDialogEvent(QString name, QJsonObject data = QJsonObject())

Triggers a dialog event (at the browsers).

They in turn typically fetch some data again in order to refresh the ui.

void setCloseableByUser(bool v = true)

Sets if this dialog shall be directly closeable by the user by the window decoration. Set to false if the user has to react on this dialog by clicking on some controls in the dialog body.

This method must be called during construction.

bool isCloseableByUser()

Returns if this dialog shall be directly closeable by the user by the window decoration.

QJsonObject toJson() override

Returns the json respesentation as QJsonObject.

QString error1()

Returns the 1st error text.

QString error2()

Returns the 2nd error text.

QString details()

Returns the error details.

QString icon()

Returns the icon (as name resolveable by sh::base::IconManager).

bool mayRetry()

Returns if it’s allowed to retry.

bool mayClose()

Returns if it’s allowed to just close and continue without closing Shallot.

bool mayCancel()

Returns if it’s allowed to cancel, i.e. throwing a sh::exceptions::CancelException.

bool showLoglabelAndDetails()

Returns if the dialog shall allow to read the details.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Slots

void cmd__icon__M(WebServerEngineRequest *request)
class WebFilePropertyDialog : public QObject, public sh::ui::web::WebDialog, public sh::ui::FilePropertyDialog
#include <webfilepropertydialog.h>

Web based file property dialog.

Public Functions

void refresh() override

Refreshes the dialog content.

FilePropertyDialogTabTableView *createTabViewTable() override

Creates a new tab view table sub-widget.

FilePropertyDialogTabTextView *createTabViewText() override

Creates a new tab view text sub-widget.

FilePropertyDialogTabIconTextBannerView *createTabViewIconTextBanner() override

Creates a new tab view icon text banner sub-widget.

WebFilePropertyDialog(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
~WebFilePropertyDialog()
QVariant dialogProperty(QString dlgPropertyKey, QVariant deflt = QVariant())

Returns a dialog property value by key.

void setDialogProperty(QString dlgPropertyKey, QVariant value)

Sets a dialog property value for a key.

QVariantHash dialogResult()

Returns the dialog result as hash.

The browser side of a web dialog can ‘accept’ a dialog while closing by setting a non-empty dialog result. This mechanism allows browser side dialogs to return data to the backend. It’s up to the backend to interpret the content of this hash.

If the dialog was cancelled, or is still open, the returned hash is empty. See also wasClosed().

void triggerDialogEvent(QString name, QJsonObject data = QJsonObject())

Triggers a dialog event (at the browsers).

They in turn typically fetch some data again in order to refresh the ui.

void setCloseableByUser(bool v = true)

Sets if this dialog shall be directly closeable by the user by the window decoration. Set to false if the user has to react on this dialog by clicking on some controls in the dialog body.

This method must be called during construction.

bool isCloseableByUser()

Returns if this dialog shall be directly closeable by the user by the window decoration.

QJsonObject toJson() override

Returns the json respesentation as QJsonObject.

QList<std::shared_ptr<FilePropertyDialogTab>> tabs()

Returns a list of all tabs.

sh::ui::FilePropertyDialogTabActionsView *widgetAt(std::shared_ptr<FilePropertyDialogTab> tab, int i)

Returns the widget from a tab at a certain index.

int widgetCount(std::shared_ptr<FilePropertyDialogTab> tab)

Returns the number of widgets in a tab.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Public Static Functions

void addTabFactory(int i, std::shared_ptr<FilePropertyDialogTabFactory> factory)

Adds a FilePropertyDialogTabFactory so the Properties dialogs show its content.

See also the REGISTER_FILEPROPERTYDIALOGTAB macro.

Parameters
  • i: An index which controls the display order. Use one of the REGISTER_FILEPROPERTYDIALOGTAB_INDEX_* values in FilePropertyDialogTabFactory as base values.

Private Functions

void tabwidgetTableSelect(int cookie, int tabidx, int widgetidx, QList<int> lsel)
void triggerAction(int cookie, int tabidx, int widgetidx, int btnidx)
QJsonArray getProperties()

Private Members

int _cookie = 0
QTimer _refreshTimer
QList<WebFilePropertyDialogChild*> _childs

Private Slots

void cmd__get_properties__M(WebServerEngineRequest *request)
void cmd__refresh__M(WebServerEngineRequest *request)
void cmd__trigger_action__M(WebServerEngineRequest *request)
void cmd__tabwidget_table_select__M(WebServerEngineRequest *request)
class WebFilePropertyDialogChild

Subclassed by sh::ui::web::WebFilePropertyDialog::WebFilePropertyDialogTabActionsView, sh::ui::web::WebFilePropertyDialog::WebFilePropertyDialogTabIconTextBannerView, sh::ui::web::WebFilePropertyDialog::WebFilePropertyDialogTabTableView, sh::ui::web::WebFilePropertyDialog::WebFilePropertyDialogTabTextView

Public Functions

WebFilePropertyDialogChild(WebFilePropertyDialog *dlg)
~WebFilePropertyDialogChild()
class WebFilePropertyDialogTabActionsView : public sh::ui::FilePropertyDialogTabActionsView, public sh::tools::Jsonable, public sh::ui::web::WebFilePropertyDialog::WebFilePropertyDialogChild

Public Functions

WebFilePropertyDialogTabActionsView(WebFilePropertyDialog *dlg)
void setVisible(bool v) override

Sets the view visible or hidden. .

void setContent(FilePropertyDialogTabViewContent *cnt) override

Sets the main widget. .

void setButtons(QList<QString> buttons) override

Sets the list of buttons. .

void setLabelText(QString text)
QJsonObject toJson() override

Returns the json respesentation as QJsonObject.

FilePropertyDialogTabViewContent *content()

The main widget.

QList<QString> buttons()

The list of buttons.

void onButtonTriggered(std::function<void(int i)> fct, QObject *owner = 0, )

Sets a handler for a click on one of the buttons (optionally bound to an owner lifetime).

Private Members

bool _visible = false
QString _labelText

Friends

friend class WebFilePropertyDialog
class WebFilePropertyDialogTabIconTextBannerView : public sh::ui::FilePropertyDialogTabIconTextBannerView, public sh::tools::Jsonable, public sh::ui::web::WebFilePropertyDialog::WebFilePropertyDialogChild

Public Functions

WebFilePropertyDialogTabIconTextBannerView(WebFilePropertyDialog *dlg)
void clear() override

Clears the contents.

void insertIcon(QIcon icon, int sizePt = 24) override

Adds an icon.

void insertText(QString text) override

Adds a text.

QJsonObject toJson() override

Returns the json respesentation as QJsonObject.

Private Members

QList<WebIconTextBannerItem> _content
class WebFilePropertyDialogTabTableView : public sh::ui::FilePropertyDialogTabTableView, public sh::tools::Jsonable, public sh::ui::web::WebFilePropertyDialog::WebFilePropertyDialogChild

Public Types

typedef QPair<int, int> ItemIndex

Public Functions

WebFilePropertyDialogTabTableView(WebFilePropertyDialog *dlg)
void setContent(QList<QPair<QString, QString>> content) override

Sets the content.

QList<ItemIndex> getSelectedItems() override

Returns the selected cells.

QVariant getItemValue(int r, int c) override

Returns a value of a cell.

QJsonObject toJson() override

Returns the json respesentation as QJsonObject.

void setSelectedItems(QList<int> selitms)

Private Members

QList<QPair<QString, QString>> _content
QList<int> _selectedItems
class WebFilePropertyDialogTabTextView : public sh::ui::FilePropertyDialogTabTextView, public sh::tools::Jsonable, public sh::ui::web::WebFilePropertyDialog::WebFilePropertyDialogChild

Public Functions

WebFilePropertyDialogTabTextView(WebFilePropertyDialog *dlg)
void setContent(QString content) override

Sets the content.

QJsonObject toJson() override

Returns the json respesentation as QJsonObject.

Private Members

QString _content
class WebFileView : public sh::ui::FileView
#include <webfileview.h>

Web based file view.

Public Functions

WebFileView(WebFileViewManager *manager)
sh::ui::ColumnDimensions *columndimensions() override

Returns the column dimensions handler. .

sh::tools::HistoryTracker<std::shared_ptr<const sh::filesystem::Eurl>> *historyTracker() override

Returns the history tracker. .

FileViewMode viewmode() override

Returns the view mode (icons, list, … ?). .

void setViewmode(FileViewMode m) override

Sets the view mode. .

int index() override

Returns the position of this file view within the panel. .

void gotoDir(std::shared_ptr<sh::filesystem::FilesystemNode> n) override

Jumps to a new current directory.

Implementations have to call the base class implementation inside.

sh::filesystem::SizeFormatting getSizeFormattingMode() override

Returns the mode how file sizes are formatted for displaying. .

void setSizeFormattingMode(sh::filesystem::SizeFormatting mode) override

Sets the mode how file sizes are formatted for displaying. .

bool hiddenFilesVisible() override

Returns if hidden files are visible. .

void setHiddenFilesVisible(bool v) override

Sets the visibility of hidden files. .

int iconDimension() override

Returns the icon size (in pixels). .

void setIconDimension(int v) override

Sets the icon size (in pixels). .

void setSort(int column, Qt::SortOrder order) override

Sets how to sort this view. .

int sortColumn() override

Returns the index of the current sort column. .

Qt::SortOrder sortOrder() override

Returns the current sort order. .

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> selectedNodes() override

Returns the nodes which the user has selected in this fileview. .

void setSelection(const QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) override

Sets the node selection of this fileview. .

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> getAllVisibleNodes() override

Returns a list of all nodes currently listed in this file view. .

qint64 id()

Returns the unique identifier.

std::shared_ptr<sh::filesystem::FilesystemModelFileviewProxy> model()

Returns the filesystem model bound to this view.

std::shared_ptr<sh::filesystem::FilesystemNode> node()

Returns the current directory.

void reload(bool skipModel = false)

Reloads the data inside this file view.

sh::filesystem::FilesystemModelFileviewProxy *filemodel()

Returns the filesystem model for this view. .

void setFilemodel(sh::filesystem::FilesystemModelFileviewProxy *model)

Sets the filesystem model for this view. .

Signals

void currentNodeChanged()
void modelChanged()
void selectionChanged()

Triggered when the selection have changed.

void viewOptionChanged()

Triggered when some view options have changed.

Private Functions

void _set_model()
void setSelectedNode(std::shared_ptr<sh::filesystem::FilesystemNode> node)
void setCheckedNodes(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)

Private Members

std::shared_ptr<sh::filesystem::FilesystemModelFileviewProxy> _model
qint64 _id
FileViewMode _viewmode = FileViewMode::ListView
sh::filesystem::SizeFormatting _sizeformatting = sh::filesystem::SizeFormatting::SizeFormattingModePrefixes
bool _hiddenFilesVisible = false
int _iconDimension = 20
int _sortColumn = 0
Qt::SortOrder _sortOrder = Qt::SortOrder::AscendingOrder
std::shared_ptr<sh::filesystem::FilesystemNode> _selectedNode
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> _checkedNodes
WebFileViewManager *_manager

Friends

friend class WebFileViewManager
class WebFileViewManager : public QObject, public sh::ui::web::WebModule
#include <webfileview.h>

Manages WebFileView instances.

Public Functions

bool executeCommand(WebServerEngineRequest *request, QString command) override

Executes command as requested by the browser, if responsible.

Read parameters, check if this module is responsible for answering, and then write an answer with request.

Implementations often use executeCommand_byQObjectReflection() for convenience.

Return

If it handled (answered) the command.

std::shared_ptr<WebFileView> addFileView(bool reinitialize)
void setCurrentFileViewByIndex(int idx)
sh::ui::web::WebFileView *currentFileView()
int fileViewCount()
void removeFileView(int i)
sh::ui::web::WebFileView *getFileView(int i)
int getFileViewIndex(sh::ui::FileView *fileview)
bool rootCommand(WebServerEngineRequest *request, QString webadapter)

Returns the root (‘index.html’) content. .

void setEngine(WebServerEngine *webserver)

Assigns this web module to a sh::ui::web::WebServerEngine. .

WebServerEngine *webserver()

Returns the sh::ui::web::WebServerEngine this web module is assigned to (may be nullptr).

Signals

void activeSelectionChanged()
void fileViewOptionsChanged(int i)
void fileViewCountChanged()
void currentFileViewChanged()

Public Static Functions

bool executeCommand_byQObjectReflection(QObject *o, WebServerEngineRequest *request, QString command, QString justLeftside = QString())

Convenience function often used by executeCommand().

For a QObject, it searches there for a slot with the name cmd_{command}, with `’/’s replaced by’_’s (so, for the command”foo/get_bars”, it searches for slotcmd_foo_get_bars`). If it finds one, it gets executed (in a worker thread). The request is considered as handled, if so.

If there is such a slot, but with appended __M in name, it is called in main thread!

Return

If it handled (answered) the command.

Private Members

QList<std::shared_ptr<WebFileView>> _fileviews
int _icurrentfileview = 0

Private Slots

void cmd__checkednodes_changed__M(WebServerEngineRequest *request)
void cmd__focus_current__M(WebServerEngineRequest *request)
void cmd__get__M(WebServerEngineRequest *request)
void cmd__list_view_items__M(WebServerEngineRequest *request)
void cmd__node_activated__M(WebServerEngineRequest *request)
void cmd__selection_changed__M(WebServerEngineRequest *request)
class WebI18n
#include <webi18n.h>

Web related helpers for internationalization/translations.

Public Static Functions

QString get()

Returns the Javascript representation for translated strings (in current ui language).

class WebLogViewDialog : public QObject, public sh::ui::web::WebDialog, public sh::ui::LogViewDialog
#include <weblogviewdialog.h>

Web based log view dialog.

Public Functions

WebLogViewDialog(QString headtext, QString subheadtxt, sh::base::LogSeverity minseverity)
QVariant dialogProperty(QString dlgPropertyKey, QVariant deflt = QVariant())

Returns a dialog property value by key.

void setDialogProperty(QString dlgPropertyKey, QVariant value)

Sets a dialog property value for a key.

QVariantHash dialogResult()

Returns the dialog result as hash.

The browser side of a web dialog can ‘accept’ a dialog while closing by setting a non-empty dialog result. This mechanism allows browser side dialogs to return data to the backend. It’s up to the backend to interpret the content of this hash.

If the dialog was cancelled, or is still open, the returned hash is empty. See also wasClosed().

void triggerDialogEvent(QString name, QJsonObject data = QJsonObject())

Triggers a dialog event (at the browsers).

They in turn typically fetch some data again in order to refresh the ui.

void setCloseableByUser(bool v = true)

Sets if this dialog shall be directly closeable by the user by the window decoration. Set to false if the user has to react on this dialog by clicking on some controls in the dialog body.

This method must be called during construction.

bool isCloseableByUser()

Returns if this dialog shall be directly closeable by the user by the window decoration.

QJsonObject toJson() override

Returns the json respesentation as QJsonObject.

QString headtext()

Returns the header text.

QString subheadtxt()

Returns the 2nd header text.

sh::base::LogSeverity minimumSeverity()

Returns the minimum severity.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Slots

void cmd__get_messages(WebServerEngineRequest *request)
class WebMainWindow : public QObject, public sh::ui::MainWindow, public sh::ui::web::WebModule
#include <webmainwindow.h>

The web main window implementation.

Public Functions

WebMainWindow(QString dispatcherUrl, QByteArray wtoken)
~WebMainWindow()
WebServerEngine *webserver()

Returns the WebServerEngine instance for this main window.

void initialize() override

Initializes this main window. .

std::shared_ptr<DialogManager> dialogManager() override

Returns the DialogManager which creates and drives Dialogs for this main window.

You typically should not need to use it directly.

int fileViewCount() override

Returns the current number of file views. .

void addFileView(bool reinitialize = false) override

Adds a new file view. .

void removeFileView(int i) override

Removes a file view. .

sh::ui::FileView *currentFileView() override

Returns the file view which is currently active (i.e. focussed). .

sh::ui::FileView *getFileView(int i) override

Returns a file view by position index. .

void jumpToNode(std::shared_ptr<sh::filesystem::FilesystemNode> node) override

Let the current view jump to another location. .

std::shared_ptr<sh::filesystem::FilesystemNode> currentDirectory() override

Gets the sh::filesystem::FilesystemNode selected in the current view. .

void setTitlePattern(QString value) override

Sets the window title pattern. .

void setTreeVisible(bool v) override

Sets the visibility of the directory tree. .

void setTreeSticky(bool v) override

Sets if the directory tree should follow the active file view. .

void setFileDetailsPanelVisible(bool v) override

Sets the visibility of the file details panel. .

std::shared_ptr<sh::ui::ActionExecutionInfoPanel> addInfoPanel(int position, sh::actions::ActionExecutionInfo *info, QColor color = QColor()) override

Creates a new action execution panel.

Let this smart pointer die for removing it.

void jumpbarSetTextMode() override

Sets the jumpbar to text input mode. .

void jumpbarSetButtonMode() override

Sets the jumpbar to button mode. .

bool jumpbarIsTextMode() override

Returns if the jumpbar is in text input mode. .

QString toolbarPosition() override

Returns the current toolbar position. .

void setToolbarPosition(QString pos) override

Sets the toolbar position. .

QString detailPanelPosition() override

Returns the current detail panel position. .

void setDetailPanelPosition(QString pos) override

Sets the detail panel position. .

std::shared_ptr<AboutDialog> showAboutDialog() override

Shows and returns an ‘About’ dialog. .

std::shared_ptr<ManageProfilesDialog> showManageProfilesDialog() override

Shows and returns a ‘Manage Saved Settings’ dialog. .

std::shared_ptr<OpenWithDialog> showOpenWithDialog(std::shared_ptr<sh::filesystem::FilesystemNode> node, QList<std::shared_ptr<sh::tools::filetypes::OpenMethod>> openMethods) override

Shows and returns a ‘Open With’ dialog. .

std::shared_ptr<StoreProfileDialog> showStoreProfileDialog(std::shared_ptr<const sh::filesystem::Eurl> eurl) override

Shows and returns a ‘Save Settings’ dialog. .

std::shared_ptr<TuningDialog> showTuningDialog() override

Shows and returns a ‘Tuning’ dialog. .

std::shared_ptr<LogViewDialog> showLogViewDialog(QString headtext = QString(), QString subheadtxt = QString(), sh::base::LogSeverity minseverity = sh::base::LogSeverity::_DEFAULT) override

Shows and returns a ‘Log’ dialog. .

std::shared_ptr<ManageBookmarksDialog> showManageBookmarksDialog() override

Shows and returns a ‘Manage Bookmarks’ dialog. .

std::shared_ptr<FilePropertyDialog> showFilePropertyDialog(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) override

Shows and returns a ‘File Properties’ dialog. .

std::shared_ptr<ActionExecutionInfoDialog> createActionExecutionInfoDialog(sh::actions::ActionExecutionInfo *info) override

Creates an action execution dialog. .

void handleCloseAppRejected(QString rejectmsg) override

React on a rejected application close request (with some feedback message). .

void _initialize(sh::base::SingletonInitializer *singletonInitializer)

Initializes the main window. For custom initialization logic, see MainWindow.initialize. .

void fileViewsReloadAll()

Reload all content in each file view.

void onFileViewOptionsChanged(std::function<void(int)> fct, QObject *owner = 0, )

Sets a handler for some view options in a file view changed (optionally bound to an owner lifetime).

void onCurrentFileViewChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for the currently active file view changed (optionally bound to an owner lifetime).

void onFileViewCountChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for the number of file views changed (optionally bound to an owner lifetime).

void onCurrentDirectoryChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for the current directory in the active file view changed (optionally bound to an owner lifetime).

void onGlobalViewOptionsChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for some global view options changed (optionally bound to an owner lifetime).

void onCurrentProfileChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for the current profile changed (optionally bound to an owner lifetime).

void jumpToEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Let the current view jump to another location. .

QString titlePattern()

Returns the window title pattern.

void setCurrentProfile(QString profile)

Sets the current profile. .

QString currentProfile()

Returns the current profile.

void reloadProfile()

Reloads the profile data.

bool treeVisible()

Returns the visibility of the directory tree.

bool treeSticky()

Returns if the directory tree follows the active file view.

bool fileDetailsPanelVisible()

Returns the visibility of the file details panel.

std::shared_ptr<sh::ui::ActionExecutionInfoPanel> addInfoPanel(sh::actions::ActionExecutionInfo *info, QColor color = QColor())

Creates a new action execution panel.

Let this smart pointer die for removing it.

std::shared_ptr<ActionExecutionInfoPanel> showErrorPanel()

Shows an error panel.

void _closeDirectly()

Directly begin application shutdown without checks.

bool closeApp()

Check if the application may shut down now, and if so, initiate it.

bool isCloseable(QString *msg = nullptr)

Check if the application may shut down now.

void handleClosed()

Do some cleanup steps just when closing starts. Implementations must call base implementation!

bool isClosing()

Returns if the application is currently closing.

bool rootCommand(WebServerEngineRequest *request, QString webadapter)

Returns the root (‘index.html’) content. .

void setEngine(WebServerEngine *webserver)

Assigns this web module to a sh::ui::web::WebServerEngine. .

Public Static Functions

bool tryCreateMainWindow(MainWindow *&mainWindow)
WebMainWindow *mainWindow()
void openUrlOnDesktop(QUrl url)

Opens a url on the user desktop, typically in the browser.

Note: It obeys the ‘openbrowser’ ui parameter.

void setMainWindow(MainWindow *mainWindow)

Sets the main window instance. .

bool isReady()

Returns if this process ui is ready (i.e. is created or runs headless).

bool runsHeadless()

Returns if this process runs headless, i.e. without any ui, just for a background process.

void _closeDirectly(sh::base::SingletonInitializer *singletonInitializer)
QString uiMode()

Returns the UI mode (e.g. qt, web).

bool executeCommand_byQObjectReflection(QObject *o, WebServerEngineRequest *request, QString command, QString justLeftside = QString())

Convenience function often used by executeCommand().

For a QObject, it searches there for a slot with the name cmd_{command}, with `’/’s replaced by’_’s (so, for the command”foo/get_bars”, it searches for slotcmd_foo_get_bars`). If it finds one, it gets executed (in a worker thread). The request is considered as handled, if so.

If there is such a slot, but with appended __M in name, it is called in main thread!

Return

If it handled (answered) the command.

Private Functions

std::shared_ptr<sh::ui::web::WebActionManager> actionManager()
void setCloseable(bool closeable, QString message = QString()) override

Sets the closeable state and message.

void setCurrentEurlByNode(std::shared_ptr<sh::filesystem::FilesystemNode> node)

Private Members

bool _treeSticky = true
bool _detailsPanelVisible = true
QString _currentProfile
WebServerEngine *_webserver
std::shared_ptr<sh::filesystem::FilesystemNode> _currentDirectory = 0
std::shared_ptr<WebActionManager> _actionManager
std::shared_ptr<WebDetailPanelManager> _detailPanelManager
std::shared_ptr<WebDialogManager> _dialogManager
std::shared_ptr<WebFileViewManager> _fileViewManager
QString _lastCloseableState

Private Slots

void cmd_filesystem_get_icon(WebServerEngineRequest *request)
void cmd_filesystem_list_items(WebServerEngineRequest *request)
void cmd_log_as_text(WebServerEngineRequest *request)
void cmd_log_log_message(WebServerEngineRequest *request)
void cmd_mainwindow_set_current_directory(WebServerEngineRequest *request)
void cmd_mainwindow_shallot_icon(WebServerEngineRequest *request)
void cmd_mainwindow_show_logview(WebServerEngineRequest *request)

Private Static Attributes

WebMainWindow *_webMainWindow = nullptr

Friends

friend class WebFileViewManager
friend class WebActionExecutionInfoPanel
friend class WebActionExecutionInfoDialog
friend class WebDetailPanelManager
class WebManageBookmarksDialog : public QObject, public sh::ui::web::WebDialog, public sh::ui::ManageBookmarksDialog
#include <webmanagebookmarksdialog.h>

Web based manage bookmarks dialog.

Public Functions

WebManageBookmarksDialog()
QVariant dialogProperty(QString dlgPropertyKey, QVariant deflt = QVariant())

Returns a dialog property value by key.

void setDialogProperty(QString dlgPropertyKey, QVariant value)

Sets a dialog property value for a key.

QVariantHash dialogResult()

Returns the dialog result as hash.

The browser side of a web dialog can ‘accept’ a dialog while closing by setting a non-empty dialog result. This mechanism allows browser side dialogs to return data to the backend. It’s up to the backend to interpret the content of this hash.

If the dialog was cancelled, or is still open, the returned hash is empty. See also wasClosed().

void triggerDialogEvent(QString name, QJsonObject data = QJsonObject())

Triggers a dialog event (at the browsers).

They in turn typically fetch some data again in order to refresh the ui.

void setCloseableByUser(bool v = true)

Sets if this dialog shall be directly closeable by the user by the window decoration. Set to false if the user has to react on this dialog by clicking on some controls in the dialog body.

This method must be called during construction.

bool isCloseableByUser()

Returns if this dialog shall be directly closeable by the user by the window decoration.

QJsonObject toJson() override

Returns the json respesentation as QJsonObject.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Slots

void cmd__add_bookmark__M(WebServerEngineRequest *request)
void cmd__delete_bookmark(WebServerEngineRequest *request)
void cmd__get(WebServerEngineRequest *request)
void cmd__move_bookmark_down(WebServerEngineRequest *request)
void cmd__move_bookmark_to_folder(WebServerEngineRequest *request)
void cmd__move_bookmark_up(WebServerEngineRequest *request)
void cmd__store(WebServerEngineRequest *request)
class WebManageProfilesDialog : public QObject, public sh::ui::web::WebDialog, public sh::ui::ManageProfilesDialog
#include <webmanageprofilesdialog.h>

Web based manage saved settings dialog.

Public Functions

WebManageProfilesDialog()
QVariant dialogProperty(QString dlgPropertyKey, QVariant deflt = QVariant())

Returns a dialog property value by key.

void setDialogProperty(QString dlgPropertyKey, QVariant value)

Sets a dialog property value for a key.

QVariantHash dialogResult()

Returns the dialog result as hash.

The browser side of a web dialog can ‘accept’ a dialog while closing by setting a non-empty dialog result. This mechanism allows browser side dialogs to return data to the backend. It’s up to the backend to interpret the content of this hash.

If the dialog was cancelled, or is still open, the returned hash is empty. See also wasClosed().

void triggerDialogEvent(QString name, QJsonObject data = QJsonObject())

Triggers a dialog event (at the browsers).

They in turn typically fetch some data again in order to refresh the ui.

void setCloseableByUser(bool v = true)

Sets if this dialog shall be directly closeable by the user by the window decoration. Set to false if the user has to react on this dialog by clicking on some controls in the dialog body.

This method must be called during construction.

bool isCloseableByUser()

Returns if this dialog shall be directly closeable by the user by the window decoration.

QJsonObject toJson() override

Returns the json respesentation as QJsonObject.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Slots

void cmd__get__M(WebServerEngineRequest *request)
void cmd__icon(WebServerEngineRequest *request)
void cmd__remove_node__M(WebServerEngineRequest *request)
void cmd__remove_profile__M(WebServerEngineRequest *request)
class WebModule
#include <webmodule.h>

Base class for modules, which provide some functionaly on top of a web server engine.

Subclassed by sh::ui::web::WebActionManager, sh::ui::web::WebDetailPanelManager, sh::ui::web::WebDialogManager, sh::ui::web::WebFileViewManager, sh::ui::web::WebMainWindow, sh::ui::web::WebServerEngineDispatcher, sh::ui::web::WebServerEngineMainModule

Public Functions

WebModule()
~WebModule()
bool executeCommand(WebServerEngineRequest *request, QString command)

Executes command as requested by the browser, if responsible.

Read parameters, check if this module is responsible for answering, and then write an answer with request.

Implementations often use executeCommand_byQObjectReflection() for convenience.

Return

If it handled (answered) the command.

bool rootCommand(WebServerEngineRequest *request, QString webadapter)

Returns the root (‘index.html’) content. .

void setEngine(WebServerEngine *webserver)

Assigns this web module to a sh::ui::web::WebServerEngine. .

WebServerEngine *webserver()

Returns the sh::ui::web::WebServerEngine this web module is assigned to (may be nullptr).

Public Static Functions

bool executeCommand_byQObjectReflection(QObject *o, WebServerEngineRequest *request, QString command, QString justLeftside = QString())

Convenience function often used by executeCommand().

For a QObject, it searches there for a slot with the name cmd_{command}, with `’/’s replaced by’_’s (so, for the command”foo/get_bars”, it searches for slotcmd_foo_get_bars`). If it finds one, it gets executed (in a worker thread). The request is considered as handled, if so.

If there is such a slot, but with appended __M in name, it is called in main thread!

Return

If it handled (answered) the command.

Private Members

WebServerEngine *_webserver = nullptr
class WebOpenWithDialog : public QObject, public sh::ui::web::WebDialog, public sh::ui::OpenWithDialog
#include <webopenwithdialog.h>

Web based open with dialog.

Public Functions

WebOpenWithDialog(std::shared_ptr<sh::filesystem::FilesystemNode> node, QList<std::shared_ptr<sh::tools::filetypes::OpenMethod>> openMethods)
std::shared_ptr<sh::tools::filetypes::OpenMethod> chosenMethod() override

Returns the chosen open-method (program for opening the file).

bool rememberForMimetype() override

Returns if the chosen method is checked to be remembered for the same mime-type in the future.

std::shared_ptr<const sh::filesystem::Eurl> rememberForDirectory() override

If it’s checked for the chosen method to be remembered for some subdirectory in the future, it returns the Eurl of this subdirectory, otherwise nullptr.

bool rememberForFile() override

Returns if the chosen method is checked to be remembered for the same file in the future.

QVariant dialogProperty(QString dlgPropertyKey, QVariant deflt = QVariant())

Returns a dialog property value by key.

void setDialogProperty(QString dlgPropertyKey, QVariant value)

Sets a dialog property value for a key.

QVariantHash dialogResult()

Returns the dialog result as hash.

The browser side of a web dialog can ‘accept’ a dialog while closing by setting a non-empty dialog result. This mechanism allows browser side dialogs to return data to the backend. It’s up to the backend to interpret the content of this hash.

If the dialog was cancelled, or is still open, the returned hash is empty. See also wasClosed().

void triggerDialogEvent(QString name, QJsonObject data = QJsonObject())

Triggers a dialog event (at the browsers).

They in turn typically fetch some data again in order to refresh the ui.

void setCloseableByUser(bool v = true)

Sets if this dialog shall be directly closeable by the user by the window decoration. Set to false if the user has to react on this dialog by clicking on some controls in the dialog body.

This method must be called during construction.

bool isCloseableByUser()

Returns if this dialog shall be directly closeable by the user by the window decoration.

QJsonObject toJson() override

Returns the json respesentation as QJsonObject.

std::shared_ptr<sh::filesystem::FilesystemNode> node()

Returns the file node which is later to be opened.

QList<std::shared_ptr<tools::filetypes::OpenMethod>> openMethods()

Returns the open-methods (programs for opening the file) to present for choice.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Slots

void cmd__check_another_ancestor__M(WebServerEngineRequest *request)
void cmd__check_custom_opener__M(WebServerEngineRequest *request)
void cmd__open_method_icon__M(WebServerEngineRequest *request)
void cmd__open_methods__M(WebServerEngineRequest *request)
class WebServerEngine
#include <webserverengine.h>

Abstract base class for a web server engine.

Such an engine implements an http server which a browser can connect to.

Public Functions

WebServerEngine(bool withMainModule, int minport, int maxport, QString externalUrl, QString dispatcherUrl, QByteArray wtoken)
~WebServerEngine()
QUrl url() = 0

Returns the home url of this engine (where the end user can point the browser to). .

QUrl externalUrl()

Returns the external root url for creating full externally valid urls (even behind reverse proxies).

Returns url() if no external root url is specified.

Change this by the cmdline parameter 'externalUrl'.

QUrl dispatcherUrl()

Returns the internal root url of the dispatcher (workers only).

QByteArray dispatcherWtoken()

Returns the wtoken got from the dispatcher (workers only).

QUrl getFullCommandUrl(QString command, WebCommandData data, bool external)

Generates a url path for a command.

Typically only needed for full url generation on server side.

void triggerEvent(QString name, QJsonObject data)

Triggers an event (at the clients).

void triggerEvent(QString name, QJsonValue data = QJsonValue::Undefined)
QString getConfigValue(QString key)

Returns the value for a runtime configuration key.

void setConfigValue(QString key, QString value)

Sets the runtime configuration key to a value (triggering a event updating the clients).

void getStaticFile(WebServerEngineRequest *request, QString path)

Returns a static file content (for the app itself) on a request.

QUrl rebaseUrl(QUrl rootUrl, QUrl url)

Returns a url rebased to another engine’s root url.

Used for dispatching to workers.

void addAndPreserveModule(std::shared_ptr<sh::ui::web::WebModule> module)

Plugs a WebModule into the engine and holds a pointer to it. Unplug it by calling removeModule().

void addModule(std::shared_ptr<sh::ui::web::WebModule> module)

Plugs a WebModule into the engine. Unplug it by either delete module (drop all pointers to it) or by calling removeModule().

void removeModule(sh::ui::web::WebModule *module)

Unplugs a WebModule from the engine.

qint64 currentTimestamp()

Returns the current engine timestamp.

It’s not related to real time, but just a value which is higher each time you query it.

This is used for coordination of some time-order sensitive operations on browser side.

Public Static Functions

WebServerEngine *createDispatcherEngine()

Creates and returns a web engine for a dispatcher.

WebServerEngine *createWorkerEngine(QString dispatcherUrl, QByteArray wtoken)

Creates and returns a web engine for a worker.

Parameters
  • dispatcherUrl: The root url of the dispatcher.

Private Members

const QJsonObject _jok
QMutex _configValuesMutex
QMutex _modulesMutex
int _minport
int _maxport
QUrl _externalurl
QUrl _dispatcherurl
QMap<QString, QString> _configValues
QList<std::weak_ptr<sh::ui::web::WebModule>> _modules
QList<std::shared_ptr<sh::ui::web::WebModule>> _smodules
std::shared_ptr<sh::ui::web::WebServerEngineMainModule> _mainmodule
QString _webstaticpath
qint64 _currentTimestamp = 1
QByteArray _wtoken

Private Static Functions

WebServerEngine *_createEngine(bool withMainModule, QString dispatcherUrl, QByteArray wtoken)

Friends

friend class WebServerEngineMainModule
class WebServerEngineDispatcher : public QObject, public sh::ui::web::WebModule
#include <webserverenginedispatcher.h>

The web serve engine dispatcher module, used in dispatcher mode for providing a portal url which starts Shallot instances on request and internally redirects to them.

Public Functions

WebServerEngineDispatcher()
~WebServerEngineDispatcher()
void stop()

Stops the dispatcher.

void setEngine(WebServerEngine *webserver)

Assigns this web module to a sh::ui::web::WebServerEngine. .

WebServerEngine *webserver()

Returns the sh::ui::web::WebServerEngine this web module is assigned to (may be nullptr).

Public Static Functions

WebMainWindow *handleDispatching(std::function<WebMainWindow*(QString dispatcherUrl, QByteArray wtoken)> createWndFct)

Handles dispatching and creates a new main window (in child processes) on demand via a given factory function.

void doInitialize()
void doShutdown()
bool executeCommand_byQObjectReflection(QObject *o, WebServerEngineRequest *request, QString command, QString justLeftside = QString())

Convenience function often used by executeCommand().

For a QObject, it searches there for a slot with the name cmd_{command}, with `’/’s replaced by’_’s (so, for the command”foo/get_bars”, it searches for slotcmd_foo_get_bars`). If it finds one, it gets executed (in a worker thread). The request is considered as handled, if so.

If there is such a slot, but with appended __M in name, it is called in main thread!

Return

If it handled (answered) the command.

Private Functions

bool compareHashRedirectorWebworkerUrl(QByteArray hash, QString url, QString wtoken)

Compares a hash for a redirector webworker url to other data.

WorkerProcess *spawnNewWorker(WebServerEngineRequest *request)

Spawns a new worker.

Does not execute any requests on it.

WorkerProcess *findWorkerForWtoken(QString wtoken)

Returns the worker for a wtoken.

QString wtokenFromRequestCookie(WebServerEngineRequest *request)

Returns the wtoken from a request (typically from cookie).

bool executeCommand(WebServerEngineRequest *request, QString command) override

Executes command as requested by the browser, if responsible.

Read parameters, check if this module is responsible for answering, and then write an answer with request.

Implementations often use executeCommand_byQObjectReflection() for convenience.

Return

If it handled (answered) the command.

bool rootCommand(WebServerEngineRequest *request, QString webadapter) override

Returns the root (‘index.html’) content. .

Private Members

std::shared_ptr<WebServerEngine> _webserver
QMutex _workersmutex
QHash<QString, WorkerProcess*> _workers
JanitorThread _janitor

Private Slots

void cmd__drop_worker__M(WebServerEngineRequest *request)
void cmd__set_last_user_activity(WebServerEngineRequest *request)
void cmd__set_prevent_close_message(WebServerEngineRequest *request)
void cmd__working_for(WebServerEngineRequest *request)

Private Static Functions

void start(QUrl &url)

Starts the dispatcher engine, accepting http connections and internally handling child processes.

QByteArray hashRedirectorWebworkerUrl(QString url, QString wtoken)

Compute a hash for a redirector webworker url.

Private Static Attributes

std::shared_ptr<WebServerEngineDispatcher> _dispatcher = nullptr
QString _dispatcherId = QString::fromLatin1(sh::tools::Misc::generateUniqueHash())
QString _dispatcherCookieName = QUrl::toPercentEncoding(QString("shallot_%1").arg(_dispatcherId).toLocal8Bit())
class JanitorThread : public QThread

Public Functions

JanitorThread(WebServerEngineDispatcher *dispatcher)
void run() override

Private Functions

qint64 machineMemory()

Returns the amount of memory this machine provides (in bytes).

Returns -1 if this is not supported on the target platform or it failed.

void stopWorker(WorkerProcess *worker, QString reason)
int detectGoodMaxNumberWorkersByMachineCapabilities()
QList<WorkerProcess*> stopWorkers(QList<WorkerProcess*> workers, int stopcount, QString reason)

Private Members

WebServerEngineDispatcher *_dispatcher
double _allMemory
QHash<WorkerProcess*, double> _workerMemoryUsagesLastSeconds
class WorkerProcess : public QProcess

A internal Shallot worker process driving one Shallot session.

Public Functions

QByteArray wtoken()

The wtoken (used for association and security).

QUrl rootUrl()

The worker root url.

void request(WebServerEngineRequest *request)

Make a request to the worker.

qint64 workerPid()

Returns the process id of the worker.

qint64 memoryUsage()

Returns the current memory usage of this worker (in bytes).

Returns -1 if this is not supported on the target platform or it failed.

QDateTime lastBrowserHeartbeat()

Returns when a browser was seen connected to this worker last time.

QDateTime lastUserInteraction()

Returns when a user has interacted with this worker last time.

QString clientHost()

Returns the client host this worker is serving.

It’s not guaranteed to have some specific content (maybe an ip address), but is equal for the same host, some one can count how many hosts work for one particular client host.

QString preventCloseMessage()

Returns a reason message why this worker currently should not be closed (or "" if closing is fine).

See also isClosingInappropriate().

Note: This is reported asynchronously. You must not rely on its precise information, but solely use it for monitoring.

bool isClosingFine()

Returns if it is fine to stop this worker (or if there is a good reason to not do).

See also preventCloseMessage().

Note: This is reported asynchronously. You must not rely on its precise information, but solely use it for monitoring.

Private Functions

WorkerProcess(WebServerEngineDispatcher *dispatcher, QByteArray wtoken, QString clientHost, QStringList acceptedLanguages)
bool waitOnline()

Waits until the worker is online and ready for requests (or dead).

void initialize(QString rooturl, qint64 pid)

Initializes the worker instance (which exists on the dispatcher side!) by setting some final data.

void gotBrowserHeartbeat()

Refreshes the browser heartbeat timestamp.

See lastBrowserHeartbeat().

void gotUserInteraction(int value)

Refreshes the user interaction timestamp.

See lastUserInteraction().

void setPreventCloseMessage(QString message)

Sets the preventCloseMessage (empty: closeable).

Private Members

WebServerEngineDispatcher *_dispatcher
QByteArray _wtoken
QUrl _rooturl
QMutex _mutex
QWaitCondition _cnd_inited
qint64 _pid = -1
QDateTime _lastBrowserHeartbeat
QDateTime _lastUserInteraction
QString _clientHost
QString _preventCloseMessage
QRegularExpression _reProcStatus

Friends

friend class WebServerEngineDispatcher
class WebServerEngineMainModule : public QObject, public sh::ui::web::WebModule
#include <webserverengine.h>

The web serve engine main module, providing some base services like events.

Public Functions

WebServerEngineMainModule()
~WebServerEngineMainModule()
bool executeCommand(WebServerEngineRequest *request, QString command) override

Executes command as requested by the browser, if responsible.

Read parameters, check if this module is responsible for answering, and then write an answer with request.

Implementations often use executeCommand_byQObjectReflection() for convenience.

Return

If it handled (answered) the command.

bool rootCommand(WebServerEngineRequest *request, QString webadapter) override

Returns the root (‘index.html’) content. .

void triggerEvent(QString name, QString data)

Triggers an event on browser side.

void setEngine(WebServerEngine *webserver)

Assigns this web module to a sh::ui::web::WebServerEngine. .

WebServerEngine *webserver()

Returns the sh::ui::web::WebServerEngine this web module is assigned to (may be nullptr).

Public Static Functions

bool executeCommand_byQObjectReflection(QObject *o, WebServerEngineRequest *request, QString command, QString justLeftside = QString())

Convenience function often used by executeCommand().

For a QObject, it searches there for a slot with the name cmd_{command}, with `’/’s replaced by’_’s (so, for the command”foo/get_bars”, it searches for slotcmd_foo_get_bars`). If it finds one, it gets executed (in a worker thread). The request is considered as handled, if so.

If there is such a slot, but with appended __M in name, it is called in main thread!

Return

If it handled (answered) the command.

Private Functions

qint64 lastRequestTime()

Private Members

qint64 _lastRequestTime
QMutex _mutex_lastRequestTime
QList<EventEntry*> _eventEntries
quint64 _eventEntriesLastId = 0
QMutex _mutex_eventEntries
QWaitCondition _eventEntriesCondition
EventEntryCleanupThread _eventEntryCleanupThread
StopWhenIdleThread _stopWhenIdleThread

Private Slots

void cmd_dispatcher_toclient_heartbeat(WebServerEngineRequest *request)
void cmd_events_get_next(WebServerEngineRequest *request)

Private Static Attributes

QRegularExpression _restatic
class EventEntry

Data for one occurred event.

Public Functions

EventEntry(qint64 id, qint64 time, QString name, QString data)

Public Members

const qint64 id
const qint64 time
const QString name
const QString data

Friends

friend class EventEntryCleanupThread
class EventEntryCleanupThread : public QThread

Thread for cleaning up old EventEntry instances.

Public Functions

EventEntryCleanupThread(WebServerEngineMainModule *module)

Private Members

WebServerEngineMainModule *module
class StopWhenIdleThread : public QThread

Thread for stopping the application if the remote side is gone.

Public Functions

StopWhenIdleThread(WebServerEngineMainModule *module)

Private Members

WebServerEngineMainModule *module
class WebServerEngineRequest
#include <webserverengine.h>

A web request in a WebServerEngine.

Override this together with WebServerEngine.

Public Functions

WebServerEngineRequest(QString url, QString clientHost)
QUrl url()

Returns the requested url.

Note: The url should be considered as opaque, since the exact structure depends on the engine implementation.

QString clientHost()

Returns the client host address.

QString path()

Returns the path part of the requested url.

Note: The url should be considered as opaque, since the exact structure depends on the engine implementation.

QString data(QString key)

Returns data passed as parameter along with the request by key.

int responseCode()

Returns the answered (http) response code.

QString responseMimeType()

Returns the mimetype of the answer content.

QByteArray response()

Returns the answer content.

bool responseSet()

Returns if a response was set.

void setResponse(QByteArray response, QString mimetype, int responseCode = HTTP_OK)

Sets the response.

void setResponse(QJsonArray response, int responseCode = HTTP_OK)
void setResponse(QJsonObject response, int responseCode = HTTP_OK)
QString headerData(QString key) = 0

Returns an http header value by key. .

QString getCookie(QString key) = 0

Returns an http cookie stored on browser side.

Note: This only works on dispatcher level and not in usual WebModule commands.

void setCookie(QString key, QString value, int maxAgeSecs = -1) = 0

Sets an http cookie to be returned to the browser side.

Note: This only works on dispatcher level and not in usual WebModule commands.

Public Static Attributes

const int HTTP_OK = 200
const int HTTP_SEE_OTHER = 303
const int HTTP_NOT_FOUND = 404
const int HTTP_INTERNAL_SERVER_ERROR = 500
const int HTTP_BAD_GATEWAY = 502

Private Members

QUrl _url
QString _clientHost
QString _path
QMap<QString, QString> _getdata
int _responseCode = HTTP_NOT_FOUND
QString _responseMimeType = "application/octet-stream"
QByteArray _response
bool _responseSet = false
class WebStoreProfileDialog : public QObject, public sh::ui::web::WebDialog, public sh::ui::StoreProfileDialog
#include <webstoreprofiledialog.h>

Web based save settings dialog.

Public Functions

WebStoreProfileDialog(std::shared_ptr<const sh::filesystem::Eurl> eurl)
QList<SettingEntry> checkedSettings() override

Returns the list of settings the user has checked to store.

QString profileName() override

Returns the profile the user has chosen to store settings for.

bool withSubDirectories() override

Returns if the user has chosen to apply the checked settings also for subdirectories.

QStringList inheritsFrom() override

Returns the list of profiles the user has chosen to inherit from.

bool hasGlobal() override

Returns if the user has chosen to apply the checked settings for each directory (instead of the current directory).

QVariant dialogProperty(QString dlgPropertyKey, QVariant deflt = QVariant())

Returns a dialog property value by key.

void setDialogProperty(QString dlgPropertyKey, QVariant value)

Sets a dialog property value for a key.

QVariantHash dialogResult()

Returns the dialog result as hash.

The browser side of a web dialog can ‘accept’ a dialog while closing by setting a non-empty dialog result. This mechanism allows browser side dialogs to return data to the backend. It’s up to the backend to interpret the content of this hash.

If the dialog was cancelled, or is still open, the returned hash is empty. See also wasClosed().

void triggerDialogEvent(QString name, QJsonObject data = QJsonObject())

Triggers a dialog event (at the browsers).

They in turn typically fetch some data again in order to refresh the ui.

void setCloseableByUser(bool v = true)

Sets if this dialog shall be directly closeable by the user by the window decoration. Set to false if the user has to react on this dialog by clicking on some controls in the dialog body.

This method must be called during construction.

bool isCloseableByUser()

Returns if this dialog shall be directly closeable by the user by the window decoration.

QJsonObject toJson() override

Returns the json respesentation as QJsonObject.

std::shared_ptr<const sh::filesystem::Eurl> eurl()

Returns the current directory this dialog shall work on.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Slots

void cmd__get__M(WebServerEngineRequest *request)
void cmd__store_mode__M(WebServerEngineRequest *request)
class WebTuningDialog : public QObject, public sh::ui::web::WebDialog, public sh::ui::TuningDialog
#include <webtuningdialog.h>

Web based tuning dialog.

Public Functions

WebTuningDialog()
QVariant dialogProperty(QString dlgPropertyKey, QVariant deflt = QVariant())

Returns a dialog property value by key.

void setDialogProperty(QString dlgPropertyKey, QVariant value)

Sets a dialog property value for a key.

QVariantHash dialogResult()

Returns the dialog result as hash.

The browser side of a web dialog can ‘accept’ a dialog while closing by setting a non-empty dialog result. This mechanism allows browser side dialogs to return data to the backend. It’s up to the backend to interpret the content of this hash.

If the dialog was cancelled, or is still open, the returned hash is empty. See also wasClosed().

void triggerDialogEvent(QString name, QJsonObject data = QJsonObject())

Triggers a dialog event (at the browsers).

They in turn typically fetch some data again in order to refresh the ui.

void setCloseableByUser(bool v = true)

Sets if this dialog shall be directly closeable by the user by the window decoration. Set to false if the user has to react on this dialog by clicking on some controls in the dialog body.

This method must be called during construction.

bool isCloseableByUser()

Returns if this dialog shall be directly closeable by the user by the window decoration.

QJsonObject toJson() override

Returns the json respesentation as QJsonObject.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Members

QMutex _cfgvaluesmutex
QWaitCondition _cfgvaluescondition
bool _cfgvaluesinited = false
QList<std::shared_ptr<sh::configuration::ConfigurationValue>> _cfgvalues

Private Slots

void cmd__change_configurationvalue(WebServerEngineRequest *request)
void cmd__get_configurationvalues(WebServerEngineRequest *request)

Private Static Functions

QString categoryToName(sh::configuration::ConfigurationCategory category)
QString valueTypeToName(sh::configuration::ConfigurationValueType *valueType)
QJsonObject configurationValueToJsonObject(std::shared_ptr<sh::configuration::ConfigurationValue> cfgval)
namespace engines

Web server low-level engine implementations.