1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Coding - Apply .clang-format formatting #286

Update empty method guards to new style with regex (see PR).
Used clang-format 18.1.8.
New actions to validate code formatting is added.
Update .clang-format with disabling of include sorting.
  It is temporary changes, then include will be sorted.
Apply formatting for /src and /tools folder.
The files with .hxx,.cxx,.lxx,.h,.pxx,.hpp,*.cpp extensions.
This commit is contained in:
dpasukhi
2025-01-25 20:15:22 +00:00
parent dbba6f1289
commit a5a7b3185b
14005 changed files with 1273539 additions and 1195567 deletions

View File

@@ -11,7 +11,7 @@
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
// commercial license or contractual agreement.
#include <inspector/TInspector_OpenButton.hxx>
@@ -30,8 +30,9 @@ const int RECENT_FILES_CACHE_SIZE = 10;
// function : Constructor
// purpose :
// =======================================================================
TInspector_OpenButton::TInspector_OpenButton (QObject* theParent)
: QObject (theParent), myStartButton (0)
TInspector_OpenButton::TInspector_OpenButton(QObject* theParent)
: QObject(theParent),
myStartButton(0)
{
}
@@ -44,8 +45,8 @@ QPushButton* TInspector_OpenButton::StartButton()
if (!myStartButton)
{
myStartButton = new QPushButton();
myStartButton->setIcon (QIcon (":folder_open.png"));
connect (myStartButton, SIGNAL (clicked()), this, SLOT (onStartButtonClicked()));
myStartButton->setIcon(QIcon(":folder_open.png"));
connect(myStartButton, SIGNAL(clicked()), this, SLOT(onStartButtonClicked()));
}
return myStartButton;
}
@@ -56,37 +57,42 @@ QPushButton* TInspector_OpenButton::StartButton()
// =======================================================================
void TInspector_OpenButton::onStartButtonClicked()
{
QPushButton* aButton = (QPushButton*)sender();
TCollection_AsciiString aPluginName (aButton->objectName().toStdString().c_str());
QPushButton* aButton = (QPushButton*)sender();
TCollection_AsciiString aPluginName(aButton->objectName().toStdString().c_str());
if (aPluginName.IsEmpty())
return;
QStringList aPluginRecentlyOpenedFiles;
if (myRecentlyOpenedFiles.contains(aPluginName))
{
QStringList aFileNames = myRecentlyOpenedFiles[aPluginName];
for (int i = 0; i < aFileNames.size(); i++)
{
QFileInfo aFileInfo (aFileNames[i]);
QFileInfo aFileInfo(aFileNames[i]);
if (aFileInfo.exists() && aFileInfo.isFile())
aPluginRecentlyOpenedFiles.append(aFileInfo.absoluteFilePath());
}
}
QString aFileName = TInspector_OpenFileDialog::OpenFile (0, aPluginRecentlyOpenedFiles);
aFileName = QDir().toNativeSeparators (aFileName);
if (!aFileName.isEmpty()) {
QApplication::setOverrideCursor (Qt::WaitCursor);
TInspector_OpenFileDialog::Communicator()->OpenFile (aPluginName, TCollection_AsciiString (aFileName.toUtf8().data()));
QString aFileName = TInspector_OpenFileDialog::OpenFile(0, aPluginRecentlyOpenedFiles);
aFileName = QDir().toNativeSeparators(aFileName);
if (!aFileName.isEmpty())
{
QApplication::setOverrideCursor(Qt::WaitCursor);
TInspector_OpenFileDialog::Communicator()->OpenFile(
aPluginName,
TCollection_AsciiString(aFileName.toUtf8().data()));
QFileInfo aFileInfo (aFileName);
if (!aPluginRecentlyOpenedFiles.contains (aFileInfo.absoluteFilePath()))
QFileInfo aFileInfo(aFileName);
if (!aPluginRecentlyOpenedFiles.contains(aFileInfo.absoluteFilePath()))
{
myRecentlyOpenedFiles[aPluginName].append (aFileInfo.absoluteFilePath());
myRecentlyOpenedFiles[aPluginName].append(aFileInfo.absoluteFilePath());
for (int i = 0; i < myRecentlyOpenedFiles[aPluginName].size() - RECENT_FILES_CACHE_SIZE; i++)
myRecentlyOpenedFiles[aPluginName].removeFirst();
TInspector_OpenFileDialog::SetPluginRecentlyOpenedFiles (aPluginName,
TInspector_OpenFileDialog::Communicator(), myRecentlyOpenedFiles[aPluginName]);
TInspector_OpenFileDialog::SetPluginRecentlyOpenedFiles(
aPluginName,
TInspector_OpenFileDialog::Communicator(),
myRecentlyOpenedFiles[aPluginName]);
TInspector_OpenFileDialog::Communicator()->GetPluginParameters()->StorePreferences();
}