-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check whether executable is ELF or has shebang; clean up
- Loading branch information
Showing
21 changed files
with
452 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,3 +54,4 @@ compile_commands.json | |
build/* | ||
|
||
.idea | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#ifndef APPDISCOVERY_H | ||
#define APPDISCOVERY_H | ||
|
||
#include <QStringList> | ||
|
||
#include "DbManager.h" | ||
|
||
/** | ||
* @file AppDiscovery.h | ||
* @class AppDiscovery | ||
* @brief A class for discovering and handling application locations. | ||
* | ||
* This class is responsible for discovering well-known application locations and | ||
* finding applications within those locations. | ||
*/ | ||
class AppDiscovery | ||
{ | ||
public: | ||
/** | ||
* Constructor. | ||
* | ||
* @param db A pointer to the DbManager instance for database handling. | ||
*/ | ||
AppDiscovery(DbManager *db); | ||
|
||
/** | ||
* Destructor. | ||
*/ | ||
~AppDiscovery(); | ||
|
||
/** | ||
* Retrieve a list of well-known application locations. | ||
* | ||
* @return A QStringList containing well-known application locations. | ||
*/ | ||
QStringList wellKnownApplicationLocations(); | ||
|
||
/** | ||
* Find and process applications within specified locations. | ||
* | ||
* This function searches for applications within the provided locations and | ||
* handles each discovered application using the associated DbManager instance. | ||
* | ||
* @param locationsContainingApps A list of locations to search for applications. | ||
*/ | ||
void findAppsInside(QStringList locationsContainingApps); | ||
|
||
private: | ||
DbManager *dbman; /**< A pointer to the DbManager instance. */ | ||
}; | ||
|
||
#endif // APPDISCOVERY_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
#ifndef APPLICATIONINFO_H | ||
#define APPLICATIONINFO_H | ||
|
||
#include <QString> | ||
|
||
/* | ||
* https://en.wikipedia.org/wiki/Rule_of_three_(computer_programming) | ||
* Currently being used in: | ||
* Menu (master) | ||
* launch (copy) | ||
*/ | ||
|
||
class ApplicationInfo | ||
{ | ||
public: | ||
/** | ||
* Constructor. | ||
* | ||
* Creates an instance of the ApplicationInfo class. | ||
*/ | ||
explicit ApplicationInfo(); | ||
|
||
/** | ||
* Destructor. | ||
* | ||
* Cleans up resources associated with the ApplicationInfo instance. | ||
*/ | ||
~ApplicationInfo(); | ||
|
||
/** | ||
* Get the most nested bundle path of a file. | ||
* | ||
* This function returns the name of the most nested bundle a file is in, | ||
* or an empty string if the file is not in a bundle. | ||
* | ||
* @param path The path of the file to check. | ||
* @return The bundle path or an empty string. | ||
*/ | ||
static QString bundlePath(const QString &path); | ||
|
||
/** | ||
* Get a human-readable application name for a given path. | ||
* | ||
* This function returns a nice name for the application based on its path. | ||
* | ||
* @param path The path of the application. | ||
* @return The application nice name. | ||
*/ | ||
static QString applicationNiceNameForPath(const QString &path); | ||
|
||
/** | ||
* Get the bundle path for a given process ID. | ||
* | ||
* This function returns the bundle path for a process ID, based on the | ||
* LAUNCHED_BUNDLE environment variable set by the 'launch' command. | ||
* | ||
* @param pid The process ID. | ||
* @return The bundle path. | ||
*/ | ||
static QString bundlePathForPId(unsigned int pid); | ||
|
||
/** | ||
* Get the bundle path for a given window ID. | ||
* | ||
* This function returns the bundle path associated with a window ID. | ||
* | ||
* @param id The window ID. | ||
* @return The bundle path. | ||
*/ | ||
static QString bundlePathForWId(unsigned long long id); | ||
|
||
/** | ||
* Get the path for a given window ID. | ||
* | ||
* This function returns the path associated with a window ID. | ||
* | ||
* @param id The window ID. | ||
* @return The path. | ||
*/ | ||
static QString pathForWId(unsigned long long id); | ||
|
||
/** | ||
* Get a human-readable application name for a given window ID. | ||
* | ||
* This function returns a nice name for the application associated with | ||
* a window ID. | ||
* | ||
* @param id The window ID. | ||
* @return The application nice name. | ||
*/ | ||
static QString applicationNiceNameForWId(unsigned long long id); | ||
}; | ||
|
||
#endif // APPLICATIONINFO_H |
6 changes: 3 additions & 3 deletions
6
src/applicationselectiondialog.cpp → src/ApplicationSelectionDialog.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "dbmanager.h" | ||
#include "DbManager.h" | ||
#include <QDebug> | ||
#include <QDir> | ||
#include <QDirIterator> | ||
|
File renamed without changes.
Oops, something went wrong.