Skip to content

Commit

Permalink
Merge pull request #169 from saeugetier/feature/143-code-formating
Browse files Browse the repository at this point in the history
Feature/143 code formating
  • Loading branch information
saeugetier authored Jun 19, 2024
2 parents d39f2e4 + 9aa00df commit b527c23
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 28 deletions.
14 changes: 7 additions & 7 deletions src/call_once.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
#include <QThread>

namespace CallOnce {
enum ECallOnce {
CO_Request,
CO_InProgress,
CO_Finished
};
enum ECallOnce {
CO_Request,
CO_InProgress,
CO_Finished
};

Q_GLOBAL_STATIC(QThreadStorage<QAtomicInt*>, once_flag)
Q_GLOBAL_STATIC(QThreadStorage<QAtomicInt*>, once_flag)
}

template <class Function>
Expand All @@ -32,7 +32,7 @@ inline static void qCallOnce(Function func, QBasicAtomicInt& flag)
if (protectFlag == CO_Finished)
return;
if (protectFlag == CO_Request && flag.testAndSetRelaxed(protectFlag,
CO_InProgress)) {
CO_InProgress)) {
func();
flag.fetchAndStoreRelease(CO_Finished);
}
Expand Down
8 changes: 4 additions & 4 deletions src/collageiconmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ void CollageIconModel::clear()

QString CollageIconModel::getIconName(int index)
{
if (index < 0 || index >= mIcons.count())
return QString();
if (index < 0 || index >= mIcons.count())
return QString();

const CollageIcon &icon = mIcons[index];
return icon.name();
const CollageIcon &icon = mIcons[index];
return icon.name();
}

bool CollageIconModel::showPrintable() const
Expand Down
6 changes: 3 additions & 3 deletions src/collageiconmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class CollageIconModel : public QAbstractListModel
Q_PROPERTY(bool showPrintable READ showPrintable WRITE setShowPrintable NOTIFY showPrintableChanged)
public:
enum IconRoles {
NameRole = Qt::UserRole + 1,
IconRole,
PrintableRole
NameRole = Qt::UserRole + 1,
IconRole,
PrintableRole
};

CollageIconModel(QObject *parent = 0);
Expand Down
8 changes: 4 additions & 4 deletions src/collageimagemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,10 @@ bool CollageImage::parseXml(const QDomNode &node)
if(borderMarginNode.count() == 1)
{
if(borderMarginNode.item(0).hasAttributes() &&
borderMarginNode.item(0).toElement().hasAttribute("top") &&
borderMarginNode.item(0).toElement().hasAttribute("left") &&
borderMarginNode.item(0).toElement().hasAttribute("right") &&
borderMarginNode.item(0).toElement().hasAttribute("bottom"))
borderMarginNode.item(0).toElement().hasAttribute("top") &&
borderMarginNode.item(0).toElement().hasAttribute("left") &&
borderMarginNode.item(0).toElement().hasAttribute("right") &&
borderMarginNode.item(0).toElement().hasAttribute("bottom"))
{
bool ok;
QString top = borderMarginNode.item(0).toElement().attribute("top");
Expand Down
6 changes: 3 additions & 3 deletions src/collagemodelfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ bool CollageModelFactory::parseXml(const QDomNode &node)

if(rootElement.tagName() != "catalog")
{
mErrorMsg = "Excepted 'catalog' root node";
mLine = rootElement.lineNumber();
return false;
mErrorMsg = "Excepted 'catalog' root node";
mLine = rootElement.lineNumber();
return false;
}

if(!rootElement.hasAttribute("version") || rootElement.attribute("version") != "1.0")
Expand Down
2 changes: 1 addition & 1 deletion src/fileio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ QByteArray FileIO::read()
}
else
{
file.setFileName(mSource.toLocalFile());
file.setFileName(mSource.toLocalFile());
}

if (!file.open(QIODevice::ReadOnly))
Expand Down
2 changes: 1 addition & 1 deletion src/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void FileSystem::startCopyFilesToRemovableDrive()
int progress = (100 * i + 1) / files.count();
qDebug() << "Copy file: " << imagePath + "/" + files[i] << " to: " << removableDrivePath + "/" + files[i] << " Progress: " << progress;
if(QFile::exists(removableDrivePath + "/" + files[i]))
QFile::remove(removableDrivePath + "/" + files[i]);
QFile::remove(removableDrivePath + "/" + files[i]);

if(!QFile::copy(imagePath + "/" + files[i], removableDrivePath + "/" + files[i]))
{
Expand Down
6 changes: 3 additions & 3 deletions src/standardprinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ StandardPrinter *StandardPrinter::createInternal(const QString &name)
auto printers = QPrinterInfo::availablePrinters();
for(auto printer: printers)
{
if(printer.printerName() == name)
{
if(printer.printerName() == name)
{
ptr = new StandardPrinter(printer);
break;
}
}
}
return ptr;
}
4 changes: 2 additions & 2 deletions src/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ bool System::setTime(QDateTime date)
}
}
#elif __APPLE__
#pragma message ( "setting the time is not implemented for MacOS" )
#pragma message ( "setting the time is not implemented for MacOS" )
#elif _WIN32
#pragma message ( "setting the time is not implemented for Windows" )
#pragma message ( "setting the time is not implemented for Windows" )
#endif
return (result == 0);
}
Expand Down

0 comments on commit b527c23

Please sign in to comment.