src: refactored lib/utility
* removed unused utilityMath * removed some unused functions from utility * moved time related utility functions to TimeStamp * moved path objects from utility to app/paths * moved objects in lib to lib/app * removed duplicate confirm methods in DialogView * moved utilityFile to utility/file * removed uint typedef and replaced with size_t everywhere * removed boost header in utilityUuid
This commit is contained in:
@@ -75,7 +75,7 @@ void QtLineNumberArea::paintEvent(QPaintEvent *event)
|
||||
|
||||
|
||||
QtCodeArea::QtCodeArea(
|
||||
uint startLineNumber,
|
||||
size_t startLineNumber,
|
||||
const std::string& code,
|
||||
std::shared_ptr<SourceLocationFile> locationFile,
|
||||
QtCodeNavigator* navigator,
|
||||
@@ -319,7 +319,7 @@ void QtCodeArea::setIsActiveFile(bool isActiveFile)
|
||||
m_isActiveFile = isActiveFile;
|
||||
}
|
||||
|
||||
uint QtCodeArea::getLineNumberForLocationId(Id locationId) const
|
||||
size_t QtCodeArea::getLineNumberForLocationId(Id locationId) const
|
||||
{
|
||||
for (const Annotation& annotation : m_annotations)
|
||||
{
|
||||
@@ -332,17 +332,17 @@ uint QtCodeArea::getLineNumberForLocationId(Id locationId) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::pair<uint, uint> QtCodeArea::getLineNumbersForLocationId(Id locationId) const
|
||||
std::pair<size_t, size_t> QtCodeArea::getLineNumbersForLocationId(Id locationId) const
|
||||
{
|
||||
for (const Annotation& annotation : m_annotations)
|
||||
{
|
||||
if (annotation.locationId == locationId)
|
||||
{
|
||||
return std::pair<uint, uint>(annotation.startLine, annotation.endLine);
|
||||
return std::pair<size_t, size_t>(annotation.startLine, annotation.endLine);
|
||||
}
|
||||
}
|
||||
|
||||
return std::pair<uint, uint>(0, 0);
|
||||
return std::pair<size_t, size_t>(0, 0);
|
||||
}
|
||||
|
||||
Id QtCodeArea::getLocationIdOfFirstActiveLocation(Id tokenId) const
|
||||
@@ -403,7 +403,7 @@ std::vector<Id> QtCodeArea::getLocationIdsForTokenIds(const std::set<Id>& tokenI
|
||||
|
||||
size_t QtCodeArea::getActiveLocationCount() const
|
||||
{
|
||||
uint count = 0;
|
||||
size_t count = 0;
|
||||
|
||||
for (const Annotation& annotation : m_annotations)
|
||||
{
|
||||
@@ -428,7 +428,7 @@ size_t QtCodeArea::getActiveLocationCount() const
|
||||
return count;
|
||||
}
|
||||
|
||||
QRectF QtCodeArea::getLineRectForLineNumber(uint lineNumber) const
|
||||
QRectF QtCodeArea::getLineRectForLineNumber(size_t lineNumber) const
|
||||
{
|
||||
if (lineNumber < getStartLineNumber())
|
||||
{
|
||||
@@ -680,7 +680,7 @@ void QtCodeArea::mouseMoveEvent(QMouseEvent* event)
|
||||
QScrollBar* scrollbar = horizontalScrollBar();
|
||||
int visibleContentWidth = width() - lineNumberAreaWidth();
|
||||
float deltaPosRatio = float(deltaX) / (visibleContentWidth);
|
||||
scrollbar->setValue(scrollbar->value() - utility::roundToInt(deltaPosRatio * scrollbar->pageStep()));
|
||||
scrollbar->setValue(scrollbar->value() - std::round(deltaPosRatio * scrollbar->pageStep()));
|
||||
}
|
||||
|
||||
std::vector<const Annotation*> annotations = getInteractiveAnnotationsForPosition(event->pos());
|
||||
|
||||
@@ -53,7 +53,7 @@ class QtCodeArea
|
||||
public:
|
||||
|
||||
QtCodeArea(
|
||||
uint startLineNumber,
|
||||
size_t startLineNumber,
|
||||
const std::string& code,
|
||||
std::shared_ptr<SourceLocationFile> locationFile,
|
||||
QtCodeNavigator* navigator,
|
||||
@@ -74,8 +74,8 @@ public:
|
||||
|
||||
void setIsActiveFile(bool isActiveFile);
|
||||
|
||||
uint getLineNumberForLocationId(Id locationId) const;
|
||||
std::pair<uint, uint> getLineNumbersForLocationId(Id locationId) const;
|
||||
size_t getLineNumberForLocationId(Id locationId) const;
|
||||
std::pair<size_t, size_t> getLineNumbersForLocationId(Id locationId) const;
|
||||
|
||||
Id getLocationIdOfFirstActiveLocation(Id tokenId) const;
|
||||
Id getLocationIdOfFirstActiveScopeLocation(Id tokenId) const;
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
|
||||
size_t getActiveLocationCount() const;
|
||||
|
||||
QRectF getLineRectForLineNumber(uint lineNumber) const;
|
||||
QRectF getLineRectForLineNumber(size_t lineNumber) const;
|
||||
|
||||
void findScreenMatches(const std::wstring& query, std::vector<std::pair<QtCodeArea*, Id>>* screenMatches);
|
||||
void clearScreenMatches();
|
||||
|
||||
@@ -28,7 +28,7 @@ void QtCodeField::clearAnnotationColors()
|
||||
}
|
||||
|
||||
QtCodeField::QtCodeField(
|
||||
uint startLineNumber,
|
||||
size_t startLineNumber,
|
||||
const std::string& code,
|
||||
std::shared_ptr<SourceLocationFile> locationFile,
|
||||
bool convertLocationsOnDemand,
|
||||
@@ -128,12 +128,12 @@ QSize QtCodeField::sizeHint() const
|
||||
return QSize(width + 1, height + 5);
|
||||
}
|
||||
|
||||
uint QtCodeField::getStartLineNumber() const
|
||||
size_t QtCodeField::getStartLineNumber() const
|
||||
{
|
||||
return m_startLineNumber;
|
||||
}
|
||||
|
||||
uint QtCodeField::getEndLineNumber() const
|
||||
size_t QtCodeField::getEndLineNumber() const
|
||||
{
|
||||
return m_startLineNumber + blockCount() - 1;
|
||||
}
|
||||
@@ -382,7 +382,7 @@ void QtCodeField::createAnnotations(std::shared_ptr<SourceLocationFile> location
|
||||
m_locationFile = locationFile;
|
||||
m_annotations.clear();
|
||||
|
||||
uint endLineNumber = getEndLineNumber();
|
||||
size_t endLineNumber = getEndLineNumber();
|
||||
std::set<Id> locationIds;
|
||||
|
||||
locationFile->forEachSourceLocation(
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
static void clearAnnotationColors();
|
||||
|
||||
QtCodeField(
|
||||
uint startLineNumber,
|
||||
size_t startLineNumber,
|
||||
const std::string& code,
|
||||
std::shared_ptr<SourceLocationFile> locationFile,
|
||||
bool convertLocationsOnDemand = true,
|
||||
@@ -32,8 +32,8 @@ public:
|
||||
|
||||
virtual QSize sizeHint() const Q_DECL_OVERRIDE;
|
||||
|
||||
uint getStartLineNumber() const;
|
||||
uint getEndLineNumber() const;
|
||||
size_t getStartLineNumber() const;
|
||||
size_t getEndLineNumber() const;
|
||||
|
||||
int totalLineHeight() const;
|
||||
|
||||
@@ -122,7 +122,7 @@ private:
|
||||
void createMultibyteCharacterLocationCache(const QString& code);
|
||||
int getColumnCorrectedForMultibyteCharacters(int line, int column) const;
|
||||
|
||||
const uint m_startLineNumber;
|
||||
const size_t m_startLineNumber;
|
||||
const std::string m_code;
|
||||
|
||||
std::shared_ptr<SourceLocationFile> m_locationFile;
|
||||
|
||||
@@ -126,8 +126,8 @@ QtCodeSnippet* QtCodeFile::insertCodeSnippet(const CodeSnippetParams& params)
|
||||
size_t i = 0;
|
||||
while (i < m_snippets.size())
|
||||
{
|
||||
uint start = newSnippet->getStartLineNumber();
|
||||
uint end = newSnippet->getEndLineNumber();
|
||||
size_t start = newSnippet->getStartLineNumber();
|
||||
size_t end = newSnippet->getEndLineNumber();
|
||||
|
||||
QtCodeSnippet* oldSnippet = m_snippets[i];
|
||||
|
||||
@@ -434,7 +434,7 @@ void QtCodeFile::clickedSnippetButton()
|
||||
|
||||
void QtCodeFile::clickedMaximizeButton()
|
||||
{
|
||||
uint lineNumber = 0;
|
||||
size_t lineNumber = 0;
|
||||
Id locationId = 0;
|
||||
|
||||
std::pair<QtCodeSnippet*, Id> snippet = getFirstSnippetWithActiveLocationId(0);
|
||||
|
||||
@@ -158,7 +158,7 @@ void QtCodeFileList::requestFileContent(const FilePath& filePath)
|
||||
getFile(filePath)->requestContent();
|
||||
}
|
||||
|
||||
bool QtCodeFileList::requestScroll(const FilePath& filePath, uint lineNumber, Id locationId, bool animated, ScrollTarget target)
|
||||
bool QtCodeFileList::requestScroll(const FilePath& filePath, size_t lineNumber, Id locationId, bool animated, ScrollTarget target)
|
||||
{
|
||||
QtCodeFile* file = getFile(filePath);
|
||||
if (!file)
|
||||
@@ -199,12 +199,12 @@ bool QtCodeFileList::requestScroll(const FilePath& filePath, uint lineNumber, Id
|
||||
return true;
|
||||
}
|
||||
|
||||
uint endLineNumber = 0;
|
||||
size_t endLineNumber = 0;
|
||||
if (!lineNumber)
|
||||
{
|
||||
if (locationId)
|
||||
{
|
||||
std::pair<uint, uint> lineNumbers = snippet->getLineNumbersForLocationId(locationId);
|
||||
std::pair<size_t, size_t> lineNumbers = snippet->getLineNumbersForLocationId(locationId);
|
||||
|
||||
lineNumber = lineNumbers.first;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
void updateCodeSnippet(const CodeSnippetParams& params) override;
|
||||
|
||||
void requestFileContent(const FilePath& filePath) override;
|
||||
bool requestScroll(const FilePath& filePath, uint lineNumber, Id locationId, bool animated, ScrollTarget target) override;
|
||||
bool requestScroll(const FilePath& filePath, size_t lineNumber, Id locationId, bool animated, ScrollTarget target) override;
|
||||
|
||||
void updateFiles() override;
|
||||
void showContents() override;
|
||||
|
||||
@@ -153,7 +153,7 @@ void QtCodeFileSingle::requestFileContent(const FilePath& filePath)
|
||||
}
|
||||
|
||||
bool QtCodeFileSingle::requestScroll(
|
||||
const FilePath& filePath, uint lineNumber, Id locationId, bool animated, ScrollTarget target)
|
||||
const FilePath& filePath, size_t lineNumber, Id locationId, bool animated, ScrollTarget target)
|
||||
{
|
||||
FileData file = getFileData(filePath);
|
||||
if (file.area)
|
||||
@@ -171,12 +171,12 @@ bool QtCodeFileSingle::requestScroll(
|
||||
animated = false;
|
||||
}
|
||||
|
||||
uint endLineNumber = 0;
|
||||
size_t endLineNumber = 0;
|
||||
if (!lineNumber)
|
||||
{
|
||||
if (locationId)
|
||||
{
|
||||
std::pair<uint, uint> lineNumbers = m_area->getLineNumbersForLocationId(locationId);
|
||||
std::pair<size_t, size_t> lineNumbers = m_area->getLineNumbersForLocationId(locationId);
|
||||
|
||||
lineNumber = lineNumbers.first;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
|
||||
void requestFileContent(const FilePath& filePath) override;
|
||||
bool requestScroll(
|
||||
const FilePath& filePath, uint lineNumber, Id locationId, bool animated, ScrollTarget target) override;
|
||||
const FilePath& filePath, size_t lineNumber, Id locationId, bool animated, ScrollTarget target) override;
|
||||
|
||||
void updateFiles() override;
|
||||
void showContents() override;
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
virtual void updateCodeSnippet(const CodeSnippetParams& params) = 0;
|
||||
|
||||
virtual void requestFileContent(const FilePath& filePath) = 0;
|
||||
virtual bool requestScroll(const FilePath& filePath, uint lineNumber, Id locationId, bool animated, ScrollTarget target) = 0;
|
||||
virtual bool requestScroll(const FilePath& filePath, size_t lineNumber, Id locationId, bool animated, ScrollTarget target) = 0;
|
||||
|
||||
virtual void updateFiles() = 0;
|
||||
virtual void showContents() = 0;
|
||||
|
||||
@@ -838,7 +838,7 @@ void QtCodeNavigator::scrollToSnippetIfRequested()
|
||||
}
|
||||
|
||||
void QtCodeNavigator::requestScroll(
|
||||
const FilePath& filePath, uint lineNumber, Id locationId, bool animated, QtCodeNavigateable::ScrollTarget target)
|
||||
const FilePath& filePath, size_t lineNumber, Id locationId, bool animated, QtCodeNavigateable::ScrollTarget target)
|
||||
{
|
||||
ScrollRequest req;
|
||||
req.filePath = filePath;
|
||||
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
void scrollToSnippetIfRequested();
|
||||
|
||||
void requestScroll(
|
||||
const FilePath& filePath, uint lineNumber, Id locationId, bool animated, QtCodeNavigateable::ScrollTarget target);
|
||||
const FilePath& filePath, size_t lineNumber, Id locationId, bool animated, QtCodeNavigateable::ScrollTarget target);
|
||||
|
||||
signals:
|
||||
void scrollRequest();
|
||||
@@ -172,7 +172,7 @@ private:
|
||||
}
|
||||
|
||||
FilePath filePath;
|
||||
uint lineNumber;
|
||||
size_t lineNumber;
|
||||
Id locationId;
|
||||
|
||||
bool animated;
|
||||
|
||||
@@ -40,7 +40,7 @@ QtCodeSnippet* QtCodeSnippet::merged(
|
||||
|
||||
std::string secondCode = second->getCode();
|
||||
int secondCodeStartIndex = 0;
|
||||
for (uint i = second->getStartLineNumber(); i <= first->getEndLineNumber(); i++)
|
||||
for (size_t i = second->getStartLineNumber(); i <= first->getEndLineNumber(); i++)
|
||||
{
|
||||
secondCodeStartIndex = secondCode.find("\n", secondCodeStartIndex) + 1;
|
||||
}
|
||||
@@ -124,12 +124,12 @@ QtCodeArea* QtCodeSnippet::getArea() const
|
||||
return m_codeArea;
|
||||
}
|
||||
|
||||
uint QtCodeSnippet::getStartLineNumber() const
|
||||
size_t QtCodeSnippet::getStartLineNumber() const
|
||||
{
|
||||
return m_codeArea->getStartLineNumber();
|
||||
}
|
||||
|
||||
uint QtCodeSnippet::getEndLineNumber() const
|
||||
size_t QtCodeSnippet::getEndLineNumber() const
|
||||
{
|
||||
return m_codeArea->getEndLineNumber();
|
||||
}
|
||||
@@ -163,12 +163,12 @@ void QtCodeSnippet::setIsActiveFile(bool isActiveFile)
|
||||
m_codeArea->setIsActiveFile(isActiveFile);
|
||||
}
|
||||
|
||||
uint QtCodeSnippet::getLineNumberForLocationId(Id locationId) const
|
||||
size_t QtCodeSnippet::getLineNumberForLocationId(Id locationId) const
|
||||
{
|
||||
return m_codeArea->getLineNumberForLocationId(locationId);
|
||||
}
|
||||
|
||||
std::pair<uint, uint> QtCodeSnippet::getLineNumbersForLocationId(Id locationId) const
|
||||
std::pair<size_t, size_t> QtCodeSnippet::getLineNumbersForLocationId(Id locationId) const
|
||||
{
|
||||
return m_codeArea->getLineNumbersForLocationId(locationId);
|
||||
}
|
||||
@@ -184,7 +184,7 @@ Id QtCodeSnippet::getFirstActiveLocationId(Id tokenId) const
|
||||
return m_codeArea->getLocationIdOfFirstActiveLocation(tokenId);
|
||||
}
|
||||
|
||||
QRectF QtCodeSnippet::getLineRectForLineNumber(uint lineNumber) const
|
||||
QRectF QtCodeSnippet::getLineRectForLineNumber(size_t lineNumber) const
|
||||
{
|
||||
return m_codeArea->getLineRectForLineNumber(lineNumber);
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@ public:
|
||||
QtCodeFile* getFile() const;
|
||||
QtCodeArea* getArea() const;
|
||||
|
||||
uint getStartLineNumber() const;
|
||||
uint getEndLineNumber() const;
|
||||
size_t getStartLineNumber() const;
|
||||
size_t getEndLineNumber() const;
|
||||
|
||||
int lineNumberDigits() const;
|
||||
|
||||
@@ -44,11 +44,11 @@ public:
|
||||
|
||||
void setIsActiveFile(bool isActiveFile);
|
||||
|
||||
uint getLineNumberForLocationId(Id locationId) const;
|
||||
std::pair<uint, uint> getLineNumbersForLocationId(Id locationId) const;
|
||||
size_t getLineNumberForLocationId(Id locationId) const;
|
||||
std::pair<size_t, size_t> getLineNumbersForLocationId(Id locationId) const;
|
||||
|
||||
Id getFirstActiveLocationId(Id tokenId) const;
|
||||
QRectF getLineRectForLineNumber(uint lineNumber) const;
|
||||
QRectF getLineRectForLineNumber(size_t lineNumber) const;
|
||||
|
||||
std::string getCode() const;
|
||||
|
||||
|
||||
@@ -8,9 +8,10 @@
|
||||
|
||||
#include "ApplicationSettings.h"
|
||||
#include "LicenseChecker.h"
|
||||
#include "logging.h"
|
||||
#include "MessageStatus.h"
|
||||
#include "QtRequest.h"
|
||||
#include "utility.h"
|
||||
#include "TimeStamp.h"
|
||||
#include "utilityApp.h"
|
||||
#include "utilityUuid.h"
|
||||
#include "Version.h"
|
||||
|
||||
@@ -8,14 +8,15 @@
|
||||
#include <QTextCodec>
|
||||
#include <QTimer>
|
||||
|
||||
#include "utilityQt.h"
|
||||
#include "ApplicationSettings.h"
|
||||
#include "logging.h"
|
||||
#include "FileSystem.h"
|
||||
#include "MessageSwitchColorScheme.h"
|
||||
#include "ResourcePaths.h"
|
||||
#include "utilityPathDetection.h"
|
||||
#include "utilityApp.h"
|
||||
#include "utility.h"
|
||||
#include "utilityApp.h"
|
||||
#include "utilityPathDetection.h"
|
||||
#include "utilityQt.h"
|
||||
|
||||
QtProjectWizardContentPreferences::QtProjectWizardContentPreferences(
|
||||
QtProjectWizardWindow* window
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "Application.h"
|
||||
#include "ApplicationSettings.h"
|
||||
#include "logging.h"
|
||||
#include "MessageStatus.h"
|
||||
#include "QtDialogView.h"
|
||||
#include "ScopedFunctor.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "ColorScheme.h"
|
||||
#include "FileSystem.h"
|
||||
#include "logging.h"
|
||||
#include "ResourcePaths.h"
|
||||
#include "TextAccess.h"
|
||||
#include "tracing.h"
|
||||
|
||||
@@ -329,45 +329,6 @@ DatabasePolicy QtDialogView::finishedIndexingDialog(
|
||||
return policy;
|
||||
}
|
||||
|
||||
int QtDialogView::confirm(const std::string& message, const std::vector<std::string>& options)
|
||||
{
|
||||
int result = -1;
|
||||
m_resultReady = false;
|
||||
|
||||
m_onQtThread2(
|
||||
[=, &result]()
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(QString::fromStdString(message));
|
||||
|
||||
for (const std::string& option : options)
|
||||
{
|
||||
msgBox.addButton(QString::fromStdString(option), QMessageBox::AcceptRole);
|
||||
}
|
||||
|
||||
msgBox.exec();
|
||||
|
||||
for (int i = 0; i < msgBox.buttons().size(); i++)
|
||||
{
|
||||
if (msgBox.clickedButton() == msgBox.buttons().at(i))
|
||||
{
|
||||
result = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_resultReady = true;
|
||||
}
|
||||
);
|
||||
|
||||
while (!m_resultReady)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(25));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int QtDialogView::confirm(const std::wstring& message, const std::vector<std::wstring>& options)
|
||||
{
|
||||
int result = -1;
|
||||
|
||||
@@ -48,7 +48,6 @@ public:
|
||||
size_t indexedFileCount, size_t totalIndexedFileCount, size_t completedFileCount, size_t totalFileCount,
|
||||
float time, ErrorCountInfo errorInfo, bool interrupted) override;
|
||||
|
||||
int confirm(const std::string& message, const std::vector<std::string>& options) override;
|
||||
int confirm(const std::wstring& message, const std::vector<std::wstring>& options) override;
|
||||
|
||||
void setParentWindow(QtWindow* window);
|
||||
|
||||
@@ -341,7 +341,7 @@ void QtErrorView::addErrorToTable(const ErrorInfo& error)
|
||||
m_model->item(rowNumber, Column::FILE)->setToolTip(QString::fromStdWString(error.filePath));
|
||||
|
||||
item = new QStandardItem();
|
||||
item->setData(QVariant(error.lineNumber), Qt::DisplayRole);
|
||||
item->setData(QVariant(qlonglong(error.lineNumber)), Qt::DisplayRole);
|
||||
m_model->setItem(rowNumber, Column::LINE, item);
|
||||
|
||||
m_model->setItem(rowNumber, Column::INDEXED, new QStandardItem(error.indexed ? "yes" : "no"));
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "QtDeviceScaledPixmap.h"
|
||||
#include "ResourcePaths.h"
|
||||
#include "SqliteIndexStorage.h"
|
||||
#include "utility.h"
|
||||
#include "utilityApp.h"
|
||||
#include "utilityQt.h"
|
||||
#include "Version.h"
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
#include <QRadioButton>
|
||||
#include <QPushButton>
|
||||
|
||||
#include "utilityQt.h"
|
||||
#include "QtHelpButton.h"
|
||||
#include "QtProgressBar.h"
|
||||
#include "MessageErrorsHelpMessage.h"
|
||||
#include "MessageIndexingInterrupted.h"
|
||||
#include "QtHelpButton.h"
|
||||
#include "QtProgressBar.h"
|
||||
#include "ResourcePaths.h"
|
||||
#include "utility.h"
|
||||
#include "TimeStamp.h"
|
||||
#include "utilityQt.h"
|
||||
|
||||
QtIndexingDialog::QtIndexingDialog(QWidget* parent)
|
||||
: QtWindow(true, parent)
|
||||
@@ -206,7 +206,7 @@ void QtIndexingDialog::setupReport(
|
||||
);
|
||||
|
||||
layout->addSpacing(12);
|
||||
createMessageLabel(layout)->setText("Time: " + QString::fromStdString(utility::timeToString(time)));
|
||||
createMessageLabel(layout)->setText("Time: " + QString::fromStdString(TimeStamp::secondsToString(time)));
|
||||
|
||||
layout->addSpacing(12);
|
||||
addErrorWidget(layout);
|
||||
|
||||
@@ -77,9 +77,9 @@ void QtPreferencesWindow::handleNext()
|
||||
if (needsRestart)
|
||||
{
|
||||
app->getDialogView(DialogView::UseCase::PROJECT_SETUP)->confirm(
|
||||
"<p>Please restart the application for all changes to take effect.</p><p>Note: These changes may harm "
|
||||
"the execution of the application. In case the application is not useable anymore, please run the "
|
||||
"'resetPreferences.sh' script located in your install directory.</p>"
|
||||
L"<p>Please restart the application for all changes to take effect.</p><p>Note: These changes may harm "
|
||||
L"the execution of the application. In case the application is not useable anymore, please run the "
|
||||
L"'resetPreferences.sh' script located in your install directory.</p>"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,9 @@
|
||||
#include <QSysInfo>
|
||||
|
||||
#include "FilePath.h"
|
||||
#include "utilityCxxHeaderDetection.h"
|
||||
#include "logging.h"
|
||||
#include "utility.h"
|
||||
#include "utilityCxxHeaderDetection.h"
|
||||
|
||||
CxxVs10To14HeaderPathDetector::CxxVs10To14HeaderPathDetector(VisualStudioType type, bool isExpress, ApplicationArchitectureType architecture)
|
||||
: PathDetector(visualStudioTypeToString(type) + (isExpress ? " Express" : "") + (architecture == APPLICATION_ARCHITECTURE_X86_64 ? " 64 Bit" : ""))
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <QSysInfo>
|
||||
|
||||
#include "FilePath.h"
|
||||
#include "utility.h"
|
||||
#include "utilityApp.h"
|
||||
|
||||
JavaPathDetectorWindows::JavaPathDetectorWindows(const std::string javaVersion)
|
||||
: JavaPathDetector("Java " + javaVersion + " for Windows", javaVersion)
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#include "utilityApp.h"
|
||||
|
||||
#include <mutex>
|
||||
#include <set>
|
||||
|
||||
#include <QProcess>
|
||||
#include <QSysInfo>
|
||||
#include <QThread>
|
||||
@@ -281,3 +284,13 @@ std::string utility::getOsTypeString()
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
ApplicationArchitectureType utility::getApplicationArchitectureType()
|
||||
{
|
||||
#if defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64) || defined(WIN64)
|
||||
return APPLICATION_ARCHITECTURE_X86_64;
|
||||
#else
|
||||
return APPLICATION_ARCHITECTURE_X86_32;
|
||||
#endif
|
||||
return APPLICATION_ARCHITECTURE_UNKNOWN;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#ifndef UTILITY_APP_H
|
||||
#define UTILITY_APP_H
|
||||
|
||||
#include <mutex>
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
#include "ApplicationArchitectureType.h"
|
||||
#include "OsType.h"
|
||||
#include "FilePath.h"
|
||||
|
||||
@@ -12,8 +11,10 @@ class License;
|
||||
|
||||
namespace utility
|
||||
{
|
||||
std::pair<int, std::string> executeProcess(const std::string& command, const FilePath& workingDirectory = FilePath(), const int timeout = 30000);
|
||||
std::string executeProcessUntilNoOutput(const std::string& command, const FilePath& workingDirectory, int waitTime = 10000);
|
||||
std::pair<int, std::string> executeProcess(
|
||||
const std::string& command, const FilePath& workingDirectory = FilePath(), const int timeout = 30000);
|
||||
std::string executeProcessUntilNoOutput(
|
||||
const std::string& command, const FilePath& workingDirectory, int waitTime = 10000);
|
||||
int executeProcessAndGetExitCode(
|
||||
const std::wstring& commandPath,
|
||||
const std::vector<std::wstring>& commandArguments,
|
||||
@@ -28,6 +29,7 @@ namespace utility
|
||||
|
||||
OsType getOsType();
|
||||
std::string getOsTypeString();
|
||||
ApplicationArchitectureType getApplicationArchitectureType();
|
||||
}
|
||||
|
||||
#endif // UTILITY_APP_H
|
||||
|
||||
Reference in New Issue
Block a user