|
ktexteditor_wakatime v1.5.1
Kate plugin to interface with WakaTime.
|
#include <wakatime.h>
Inherits QObject.
Public Types | |
| enum | State { ErrorSending , NothingToSend , SentSuccessfully , TooSoon , WakaTimeCliNotInPath } |
Public Member Functions | |
| WakaTime (QObject *parent=nullptr) | |
| QString | getBinPath (const QStringList &binNames) |
| QString | getProjectDirectory (const QFileInfo &fileInfo) |
| WakaTime::State | send (const QString &filePath, const QString &mode, int lineNumber, int cursorPosition, int linesInFile, bool isWrite) |
Wrapper for the wakatime-cli binary.
Definition at line 14 of file wakatime.h.
| enum State |
State returned by send().
| Enumerator | |
|---|---|
| ErrorSending |
|
| NothingToSend | Filename was empty. |
| SentSuccessfully | Successful request. |
| TooSoon | send() called too soon since last time. |
| WakaTimeCliNotInPath |
|
Definition at line 22 of file wakatime.h.
| WakaTime | ( | QObject * | parent = nullptr | ) |
Constructor.
Definition at line 12 of file wakatime.cpp.
| QString getBinPath | ( | const QStringList & | binNames | ) |
Find the full path to a file based on the PATH environment variable. Equivalent to command -v or which. Does not check if the file is executable.
| binNames | The names of the binary to find. |
Definition at line 16 of file wakatime.cpp.
Here is the caller graph for this function:| QString getProjectDirectory | ( | const QFileInfo & | fileInfo | ) |
Get the project name by traversing up until .git or .svn is found.
| fileInfo | The QFileInfo of the file to get the project directory for. |
Definition at line 47 of file wakatime.cpp.
Here is the caller graph for this function:| WakaTime::State send | ( | const QString & | filePath, |
| const QString & | mode, | ||
| int | lineNumber, | ||
| int | cursorPosition, | ||
| int | linesInFile, | ||
| bool | isWrite | ||
| ) |
Send statistics to WakaTime.
| filePath | The file path to send statistics for. |
| mode | The language mode of the file. |
| lineNumber | The line number of the cursor position. |
| cursorPosition | The column number of the cursor position. |
| linesInFile | The total number of lines in the file. |
| isWrite | Whether this is a write event (true) or just a heartbeat (false). |
Definition at line 72 of file wakatime.cpp.
Here is the call graph for this function: