-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into qt6-category
- Loading branch information
Showing
113 changed files
with
14,132 additions
and
13,949 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
# We'll use defaults from the LLVM style, but with 4 columns indentation. | ||
BasedOnStyle: LLVM | ||
IndentWidth: 2 | ||
--- | ||
Language: Cpp | ||
DeriveLineEnding: false | ||
UseCRLF: true | ||
DerivePointerAlignment: false | ||
PointerAlignment: Left | ||
AlignConsecutiveAssignments: true | ||
AllowShortFunctionsOnASingleLine: Inline | ||
AllowShortIfStatementsOnASingleLine: Never | ||
AllowShortLambdasOnASingleLine: Empty | ||
AlwaysBreakTemplateDeclarations: Yes | ||
AccessModifierOffset: -2 | ||
AlignTrailingComments: true | ||
SpacesBeforeTrailingComments: 2 | ||
NamespaceIndentation: Inner | ||
MaxEmptyLinesToKeep: 1 | ||
BreakBeforeBraces: Custom | ||
BraceWrapping: | ||
AfterCaseLabel: false | ||
AfterClass: true | ||
AfterControlStatement: false | ||
AfterEnum: true | ||
AfterFunction: true | ||
AfterNamespace: true | ||
AfterStruct: true | ||
AfterUnion: true | ||
AfterExternBlock: true | ||
BeforeCatch: false | ||
BeforeElse: false | ||
BeforeLambdaBody: false | ||
BeforeWhile: false | ||
IndentBraces: false | ||
SplitEmptyFunction: false | ||
SplitEmptyRecord: false | ||
SplitEmptyNamespace: true | ||
ColumnLimit: 88 | ||
ForEachMacros: ['Q_FOREACH', 'foreach'] |
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 @@ | ||
218607a6ce4d41112bd3995ba319255aec3c5c2e |
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,7 @@ | ||
# Set the default behavior, in case people don't have core.autocrlf set. | ||
* text=auto | ||
|
||
# Explicitly declare text files you want to always be normalized and converted | ||
# to native line endings on checkout. | ||
*.cpp text eol=crlf | ||
*.h text eol=crlf |
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,15 @@ | ||
name: Build UIBase | ||
on: | ||
push: | ||
branches: master | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
jobs: | ||
build: | ||
runs-on: windows-2022 | ||
steps: | ||
- name: Build UI Base | ||
uses: ModOrganizer2/build-with-mob-action@master | ||
with: | ||
mo2-third-parties: fmt gtest spdlog boost | ||
mo2-dependencies: cmake_common |
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,15 @@ | ||
name: Lint UIBase | ||
on: | ||
push: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Run clang-format | ||
uses: jidicula/[email protected] | ||
with: | ||
clang-format-version: "15" | ||
check-path: "." |
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,58 +1,49 @@ | ||
#include "delayedfilewriter.h" | ||
#include "log.h" | ||
|
||
|
||
using namespace MOBase; | ||
|
||
|
||
DelayedFileWriterBase::DelayedFileWriterBase(int delay) | ||
: m_TimerDelay(delay) | ||
, m_Timer() | ||
{ | ||
QObject::connect(&m_Timer, &QTimer::timeout, this, &DelayedFileWriter::timerExpired); | ||
m_Timer.setSingleShot(true); | ||
} | ||
|
||
DelayedFileWriterBase::~DelayedFileWriterBase() | ||
{ | ||
if (m_Timer.isActive()) { | ||
log::error("delayed file save timer active at shutdown"); | ||
} | ||
} | ||
|
||
void DelayedFileWriterBase::write() | ||
{ | ||
m_Timer.start(m_TimerDelay); | ||
} | ||
|
||
void DelayedFileWriterBase::cancel() | ||
{ | ||
m_Timer.stop(); | ||
} | ||
|
||
void DelayedFileWriterBase::writeImmediately(bool ifOnTimer) | ||
{ | ||
if (!ifOnTimer || m_Timer.isActive()) { | ||
m_Timer.stop(); | ||
doWrite(); | ||
} | ||
} | ||
|
||
void DelayedFileWriterBase::timerExpired() | ||
{ | ||
doWrite(); | ||
} | ||
|
||
|
||
|
||
DelayedFileWriter::DelayedFileWriter(DelayedFileWriter::WriterFunc func | ||
, int delay) | ||
: DelayedFileWriterBase(delay) | ||
, m_Func(func) | ||
{ | ||
} | ||
|
||
void DelayedFileWriter::doWrite() | ||
{ | ||
m_Func(); | ||
} | ||
#include "delayedfilewriter.h" | ||
#include "log.h" | ||
|
||
using namespace MOBase; | ||
|
||
DelayedFileWriterBase::DelayedFileWriterBase(int delay) : m_TimerDelay(delay), m_Timer() | ||
{ | ||
QObject::connect(&m_Timer, &QTimer::timeout, this, &DelayedFileWriter::timerExpired); | ||
m_Timer.setSingleShot(true); | ||
} | ||
|
||
DelayedFileWriterBase::~DelayedFileWriterBase() | ||
{ | ||
if (m_Timer.isActive()) { | ||
log::error("delayed file save timer active at shutdown"); | ||
} | ||
} | ||
|
||
void DelayedFileWriterBase::write() | ||
{ | ||
m_Timer.start(m_TimerDelay); | ||
} | ||
|
||
void DelayedFileWriterBase::cancel() | ||
{ | ||
m_Timer.stop(); | ||
} | ||
|
||
void DelayedFileWriterBase::writeImmediately(bool ifOnTimer) | ||
{ | ||
if (!ifOnTimer || m_Timer.isActive()) { | ||
m_Timer.stop(); | ||
doWrite(); | ||
} | ||
} | ||
|
||
void DelayedFileWriterBase::timerExpired() | ||
{ | ||
doWrite(); | ||
} | ||
|
||
DelayedFileWriter::DelayedFileWriter(DelayedFileWriter::WriterFunc func, int delay) | ||
: DelayedFileWriterBase(delay), m_Func(func) | ||
{} | ||
|
||
void DelayedFileWriter::doWrite() | ||
{ | ||
m_Func(); | ||
} |
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,71 +1,74 @@ | ||
#ifndef DELAYEDFILEWRITER_H | ||
#define DELAYEDFILEWRITER_H | ||
|
||
|
||
#include "dllimport.h" | ||
#include <QString> | ||
#include <QTimer> | ||
#include <functional> | ||
|
||
|
||
namespace MOBase { | ||
|
||
/** | ||
* The purpose of this class is to aggregate changes to a file before writing it out | ||
*/ | ||
class QDLLEXPORT DelayedFileWriterBase : public QObject { | ||
|
||
Q_OBJECT | ||
|
||
public: | ||
/** | ||
* @brief constructor | ||
* @param fileName | ||
* @param delay delay (in milliseconds) before we call the actual write function | ||
*/ | ||
DelayedFileWriterBase(int delay = 200); | ||
~DelayedFileWriterBase(); | ||
|
||
public slots: | ||
/** | ||
* @brief write with delay | ||
*/ | ||
void write(); | ||
|
||
/** | ||
* @brief cancel a scheduled write (does nothing if no write is scheduled) | ||
*/ | ||
void cancel(); | ||
|
||
/** | ||
* @brief write immediately without waiting for the timer to expire | ||
* @param ifOnTimer only write if the timer is running | ||
*/ | ||
void writeImmediately(bool ifOnTimer); | ||
|
||
private slots: | ||
void timerExpired(); | ||
|
||
private: | ||
virtual void doWrite() = 0; | ||
|
||
private: | ||
int m_TimerDelay; | ||
QTimer m_Timer; | ||
}; | ||
|
||
|
||
class QDLLEXPORT DelayedFileWriter : public DelayedFileWriterBase { | ||
public: | ||
typedef std::function<void()> WriterFunc; | ||
public: | ||
DelayedFileWriter(WriterFunc func, int delay = 200); | ||
private: | ||
void doWrite(); | ||
private: | ||
WriterFunc m_Func; | ||
}; | ||
|
||
} | ||
|
||
#endif // DELAYEDFILEWRITER_H | ||
#ifndef DELAYEDFILEWRITER_H | ||
#define DELAYEDFILEWRITER_H | ||
|
||
#include "dllimport.h" | ||
#include <QString> | ||
#include <QTimer> | ||
#include <functional> | ||
|
||
namespace MOBase | ||
{ | ||
|
||
/** | ||
* The purpose of this class is to aggregate changes to a file before writing it out | ||
*/ | ||
class QDLLEXPORT DelayedFileWriterBase : public QObject | ||
{ | ||
|
||
Q_OBJECT | ||
|
||
public: | ||
/** | ||
* @brief constructor | ||
* @param fileName | ||
* @param delay delay (in milliseconds) before we call the actual write function | ||
*/ | ||
DelayedFileWriterBase(int delay = 200); | ||
~DelayedFileWriterBase(); | ||
|
||
public slots: | ||
/** | ||
* @brief write with delay | ||
*/ | ||
void write(); | ||
|
||
/** | ||
* @brief cancel a scheduled write (does nothing if no write is scheduled) | ||
*/ | ||
void cancel(); | ||
|
||
/** | ||
* @brief write immediately without waiting for the timer to expire | ||
* @param ifOnTimer only write if the timer is running | ||
*/ | ||
void writeImmediately(bool ifOnTimer); | ||
|
||
private slots: | ||
void timerExpired(); | ||
|
||
private: | ||
virtual void doWrite() = 0; | ||
|
||
private: | ||
int m_TimerDelay; | ||
QTimer m_Timer; | ||
}; | ||
|
||
class QDLLEXPORT DelayedFileWriter : public DelayedFileWriterBase | ||
{ | ||
public: | ||
typedef std::function<void()> WriterFunc; | ||
|
||
public: | ||
DelayedFileWriter(WriterFunc func, int delay = 200); | ||
|
||
private: | ||
void doWrite(); | ||
|
||
private: | ||
WriterFunc m_Func; | ||
}; | ||
|
||
} // namespace MOBase | ||
|
||
#endif // DELAYEDFILEWRITER_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
/* | ||
Mod Organizer shared UI functionality | ||
Copyright (C) 2012 Sebastian Herbord. All rights reserved. | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 3 of the License, or (at your option) any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
#include "diagnosisreport.h" | ||
|
||
namespace MOBase { | ||
} // namespace MOBase | ||
/* | ||
Mod Organizer shared UI functionality | ||
Copyright (C) 2012 Sebastian Herbord. All rights reserved. | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 3 of the License, or (at your option) any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
#include "diagnosisreport.h" | ||
|
||
namespace MOBase | ||
{ | ||
} // namespace MOBase |
Oops, something went wrong.