Skip to content

Commit

Permalink
fix clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
arnost00 committed Jan 28, 2025
1 parent 226a737 commit 2135eb9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
10 changes: 3 additions & 7 deletions libqf/libqfqmlwidgets/src/framework/logwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@

namespace qfm = qf::core::model;

namespace qf {
namespace qmlwidgets {
namespace framework {
namespace qf::qmlwidgets::framework {

LogWidgetTableView::LogWidgetTableView(QWidget *parent)
: Super(parent)
Expand Down Expand Up @@ -259,7 +257,7 @@ void LogWidget::addCategoryActions(const QString &caption, const QString &id, Ne
a->setData(id);
a->setMenu(m);
tableMenuButton()->addAction(a);
QActionGroup *ag_loglevel = new QActionGroup(a);
auto ag_loglevel = new QActionGroup(a);
for (int i = static_cast<int>(NecroLog::Level::Invalid); i <= static_cast<int>(NecroLog::Level::Debug); i++) {
if(i == static_cast<int>(NecroLog::Level::Fatal))
continue;
Expand Down Expand Up @@ -364,6 +362,4 @@ void LogWidget::checkScrollToLastEntry()
}
}

} // namespace framework
} // namespace qmlwiggets
} // namespace qf
} // namespace framework::qmlwiggets::qf
22 changes: 10 additions & 12 deletions libqf/libqfqmlwidgets/src/tableview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ void TableView::rowExternallySaved(const QVariant &id, int mode)
tmd->qfm::TableModel::removeRowNoOverload(ri, !qf::core::Exception::Throw);
return;
}
else if(reloaded_row_cnt != 1) {
if(reloaded_row_cnt != 1) {
qfWarning() << "Inserted/Copied row id:" << id.toString() << "reloaded in" << reloaded_row_cnt << "instances.";
return;
}
Expand Down Expand Up @@ -1341,7 +1341,7 @@ void TableView::savePersistentSettings()
if(!path.isEmpty()) {
QSettings settings;
settings.beginGroup(path);
HeaderView *horiz_header = qobject_cast<HeaderView*>(horizontalHeader());
auto horiz_header = qobject_cast<HeaderView*>(horizontalHeader());

QByteArray header_state = horiz_header->saveState();
settings.setValue("horizontalheader", QString::fromLatin1(header_state.toBase64()));
Expand Down Expand Up @@ -1375,12 +1375,12 @@ void TableView::keyPressEvent(QKeyEvent *e)
e->accept();
return;
}
else if(e->key() == Qt::Key_V) {
if(e->key() == Qt::Key_V) {
paste();
e->accept();
return;
}
else if(e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) {
if(e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) {
qfDebug() << "\tCTRL+ENTER";
postRow();
e->accept();
Expand Down Expand Up @@ -1458,9 +1458,7 @@ void TableView::keyPressEvent(QKeyEvent *e)
e->accept();
return;
}
else {
cancelSeek();
}
cancelSeek();
//bool event_should_be_accepted = false;
/// nejedna se o inkrementalni vyhledavani, zkusime editaci
if(state() == EditingState) {
Expand Down Expand Up @@ -1808,7 +1806,7 @@ void TableView::createActions()
a->setOid("select");
m_actionGroups[SelectActions] << a->oid();
m_actions[a->oid()] = a;
QMenu *m = new QMenu(this);
auto m = new QMenu(this);
a->setMenu(m);
{
a = new Action(tr("Select current column"), this);
Expand All @@ -1835,7 +1833,7 @@ void TableView::createActions()
a->setOid("calculate");
m_actionGroups[CalculateActions] << a->oid();
m_actions[a->oid()] = a;
QMenu *m = new QMenu(this);
auto m = new QMenu(this);
a->setMenu(m);
{
a = new Action(tr("Sum column"), this);
Expand All @@ -1855,7 +1853,7 @@ void TableView::createActions()
a->setOid("export");
m_actionGroups[ExportActions] << a->oid();
m_actions[a->oid()] = a;
QMenu *m = new QMenu(this);
auto m = new QMenu(this);
a->setMenu(m);
{
a = new Action(tr("Report"), this);
Expand Down Expand Up @@ -1900,7 +1898,7 @@ void TableView::createActions()
a->setOid("import");
m_actionGroups[ImportActions] << a->oid();
m_actions[a->oid()] = a;
QMenu *m = new QMenu(this);
auto m = new QMenu(this);
a->setMenu(m);
{
a = new Action(tr("CSV"), this);
Expand Down Expand Up @@ -2126,7 +2124,7 @@ void TableView::insertRowInline()
if(tri < 0) {
qfWarning() << "Valid proxy model index has invalid table model index!";
/// this can happen when one inserts to empty table ???? why ????
tri = ri = 0;
tri = 0;
}
}
tableModel()->insertRow(tri);
Expand Down

0 comments on commit 2135eb9

Please sign in to comment.