Commit 37eede8e authored by Stefan Gerlach's avatar Stefan Gerlach

[debug] clean up

parent b20872ff
......@@ -286,7 +286,6 @@ void Column::setColumnMode(AbstractColumn::ColumnMode mode) {
if (mode == columnMode())
return;
DEBUG("Column::setColumnMode()");
beginMacro(i18n("%1: change column type", name()));
auto* old_input_filter = d->inputFilter();
......@@ -305,7 +304,6 @@ void Column::setColumnMode(AbstractColumn::ColumnMode mode) {
}
endMacro();
DEBUG("Column::setColumnMode() DONE");
}
void Column::setColumnModeFast(AbstractColumn::ColumnMode mode) {
......@@ -519,7 +517,6 @@ void Column::clearFormulas() {
* Use this only when columnMode() is Text
*/
void Column::setTextAt(int row, const QString& new_value) {
DEBUG("Column::setTextAt()");
exec(new ColumnSetTextCmd(d, row, new_value));
}
......@@ -529,7 +526,6 @@ void Column::setTextAt(int row, const QString& new_value) {
* Use this only when columnMode() is Text
*/
void Column::replaceTexts(int first, const QVector<QString>& new_values) {
DEBUG("Column::replaceTexts()");
if (!new_values.isEmpty()) //TODO: do we really need this check?
exec(new ColumnReplaceTextsCmd(d, first, new_values));
}
......@@ -577,8 +573,6 @@ void Column::replaceDateTimes(int first, const QVector<QDateTime>& new_values) {
* Use this only when columnMode() is Numeric
*/
void Column::setValueAt(int row, const double new_value) {
DEBUG("Column::setValueAt()")
DEBUG("setvalue")
exec(new ColumnSetValueCmd(d, row, new_value));
}
......@@ -588,7 +582,6 @@ void Column::setValueAt(int row, const double new_value) {
* Use this only when columnMode() is Numeric
*/
void Column::replaceValues(int first, const QVector<double>& new_values) {
DEBUG("Column::replaceValues()")
if (!new_values.isEmpty())
exec(new ColumnReplaceValuesCmd(d, first, new_values));
}
......@@ -599,7 +592,6 @@ void Column::replaceValues(int first, const QVector<double>& new_values) {
* Use this only when columnMode() is Integer
*/
void Column::setIntegerAt(int row, const int new_value) {
DEBUG("Column::setIntegerAt()")
exec(new ColumnSetIntegerCmd(d, row, new_value));
}
......@@ -609,7 +601,6 @@ void Column::setIntegerAt(int row, const int new_value) {
* Use this only when columnMode() is Integer
*/
void Column::replaceInteger(int first, const QVector<int>& new_values) {
DEBUG("Column::replaceInteger()")
if (!new_values.isEmpty())
exec(new ColumnReplaceIntegerCmd(d, first, new_values));
}
......@@ -620,7 +611,6 @@ void Column::replaceInteger(int first, const QVector<int>& new_values) {
* Use this only when columnMode() is BigInt
*/
void Column::setBigIntAt(int row, const qint64 new_value) {
DEBUG("Column::setBigIntAt()")
d->statisticsAvailable = false;
d->hasValuesAvailable = false;
d->propertiesAvailable = false;
......@@ -633,7 +623,6 @@ void Column::setBigIntAt(int row, const qint64 new_value) {
* Use this only when columnMode() is BigInt
*/
void Column::replaceBigInt(int first, const QVector<qint64>& new_values) {
DEBUG("Column::replaceInteger()")
if (!new_values.isEmpty())
exec(new ColumnReplaceBigIntCmd(d, first, new_values));
}
......@@ -1488,11 +1477,11 @@ QVector< Interval<int> > Column::formulaIntervals() const {
}
void Column::handleFormatChange() {
DEBUG("Column::handleFormatChange() mode = " << ENUM_TO_STRING(AbstractColumn, ColumnMode, columnMode()));
DEBUG(Q_FUNC_INFO << ", mode = " << ENUM_TO_STRING(AbstractColumn, ColumnMode, columnMode()));
if (columnMode() == ColumnMode::DateTime) {
auto* input_filter = static_cast<String2DateTimeFilter*>(d->inputFilter());
auto* output_filter = static_cast<DateTime2StringFilter*>(d->outputFilter());
DEBUG("change format " << STDSTRING(input_filter->format()) << " to " << STDSTRING(output_filter->format()));
DEBUG(Q_FUNC_INFO << ", change format " << STDSTRING(input_filter->format()) << " to " << STDSTRING(output_filter->format()));
input_filter->setFormat(output_filter->format());
}
......@@ -1503,7 +1492,6 @@ void Column::handleFormatChange() {
d->statisticsAvailable = false;
d->hasValuesAvailable = false;
d->propertiesAvailable = false;
DEBUG("Column::handleFormatChange() DONE");
}
/*!
......
......@@ -50,8 +50,6 @@ AbstractColumn::ColumnMode AbstractFileFilter::columnMode(const QString& valueSt
}
AbstractColumn::ColumnMode AbstractFileFilter::columnMode(const QString& valueString, const QString& dateTimeFormat, const QLocale& locale) {
DEBUG("AbstractFileFilter::columnMode()")
//TODO: use BigInt as default integer?
if (valueString.size() == 0) // empty string treated as integer (meaning the non-empty strings will determine the data type)
return AbstractColumn::ColumnMode::Integer;
......@@ -59,19 +57,19 @@ AbstractColumn::ColumnMode AbstractFileFilter::columnMode(const QString& valueSt
if (isNan(valueString))
return AbstractColumn::ColumnMode::Numeric;
const std::string stdValueString = valueString.toStdString();
// const std::string stdValueString = valueString.toStdString();
// check if integer first
bool ok;
int intValue = locale.toInt(valueString, &ok);
DEBUG("string " << stdValueString << ": toInt " << intValue << "?:" << ok);
DEBUG(Q_FUNC_INFO << ", " << STDSTRING(valueString) << " : toInt " << intValue << " ?: " << ok);
Q_UNUSED(intValue)
if (ok || isNan(valueString))
return AbstractColumn::ColumnMode::Integer;
//check big integer
qint64 bigIntValue = locale.toLongLong(valueString, &ok);
DEBUG("string " << stdValueString << ": toBigInt " << bigIntValue << "?:" << ok);
DEBUG(Q_FUNC_INFO << ", " << STDSTRING(valueString) << " : toBigInt " << bigIntValue << " ?: " << ok);
Q_UNUSED(bigIntValue)
if (ok || isNan(valueString))
return AbstractColumn::ColumnMode::BigInt;
......@@ -79,7 +77,7 @@ AbstractColumn::ColumnMode AbstractFileFilter::columnMode(const QString& valueSt
//try to convert to a double
auto mode = AbstractColumn::ColumnMode::Numeric;
double value = locale.toDouble(valueString, &ok);
DEBUG("string " << stdValueString << ": toDouble " << value << "?:" << ok);
DEBUG(Q_FUNC_INFO << ", " << STDSTRING(valueString) << " : toDouble " << value << " ?: " << ok);
Q_UNUSED(value)
//if not a number, check datetime. if that fails: string
......
......@@ -87,7 +87,6 @@ SpreadsheetHeaderView::~SpreadsheetHeaderView() {
}
QSize SpreadsheetHeaderView::sizeHint() const {
// DEBUG("SpreadsheetHeaderView::sizeHint()")
QSize master_size = QHeaderView::sizeHint();
if (m_showComments)
master_size.setHeight(master_size.height() + m_slave->sizeHint().height());
......@@ -105,7 +104,6 @@ void SpreadsheetHeaderView::setModel(QAbstractItemModel* model) {
}
void SpreadsheetHeaderView::paintSection(QPainter* painter, const QRect& rect, int logicalIndex) const {
// DEBUG("SpreadsheetHeaderView::paintSection()")
QRect master_rect = rect;
if (m_showComments)
master_rect = rect.adjusted(0, 0, 0, -m_slave->sizeHint().height());
......@@ -136,8 +134,6 @@ void SpreadsheetHeaderView::showComments(bool on) {
adjust geometry and repaint header .
*/
void SpreadsheetHeaderView::refresh() {
DEBUG("SpreadsheetHeaderView::refresh()")
//TODO
// adjust geometry and repaint header (still looking for a more elegant solution)
int width = sectionSize(count()-1);
......
......@@ -219,7 +219,6 @@ void SpreadsheetView::init() {
set the column sizes to the saved values or resize to content if no size was saved yet
*/
void SpreadsheetView::resizeHeader() {
DEBUG("SpreadsheetView::resizeHeader()");
const auto columns = m_spreadsheet->children<Column>();
int i = 0;
for (auto col: columns) {
......@@ -978,7 +977,6 @@ bool SpreadsheetView::areCommentsShown() const {
toggles the column comment in the horizontal header
*/
void SpreadsheetView::toggleComments() {
DEBUG("SpreadsheetView::toggleComments()")
showComments(!areCommentsShown());
//TODO
if (areCommentsShown())
......@@ -989,7 +987,6 @@ void SpreadsheetView::toggleComments() {
//! Shows (\c on=true) or hides (\c on=false) the column comments in the horizontal header
void SpreadsheetView::showComments(bool on) {
DEBUG("SpreadsheetView::showComments()")
m_horizontalHeader->showComments(on);
}
......@@ -3768,7 +3765,7 @@ void SpreadsheetView::exportToSQLite(const QString& path) const {
if (!q.exec(query)) {
RESET_CURSOR;
KMessageBox::error(nullptr, i18n("Failed to insert values into the table."));
QDEBUG("bulk insert error " << q.lastError().databaseText());
QDEBUG(Q_FUNC_INFO << ", bulk insert error " << q.lastError().databaseText());
} else
q.exec(QLatin1String("COMMIT TRANSACTION;"));
......
......@@ -252,8 +252,8 @@ void MainWin::initGUI(const QString& fileName) {
setupGUI(Default, KXMLGUIClient::xmlFile()); // should be "labplot2ui.rc"
#endif
DEBUG("Component name: " << STDSTRING(KXMLGUIClient::componentName()));
DEBUG("XML file: " << STDSTRING(KXMLGUIClient::xmlFile()) << " (should be \"labplot2ui.rc\")");
DEBUG(Q_FUNC_INFO << ", Component name: " << STDSTRING(KXMLGUIClient::componentName()));
DEBUG(Q_FUNC_INFO << ", XML file: " << STDSTRING(KXMLGUIClient::xmlFile()) << " (should be \"labplot2ui.rc\")");
//all toolbars created via the KXMLGUI framework are locked on default:
// * on the very first program start, unlock all toolbars
......
......@@ -59,10 +59,9 @@ SettingsGeneralPage::SettingsGeneralPage(QWidget* parent) : SettingsPage(parent)
/* returns decimal separator (as SettingsGeneralPage::DecimalSeparator) of given locale (default: system setting) */
SettingsGeneralPage::DecimalSeparator SettingsGeneralPage::decimalSeparator(QLocale locale) {
DEBUG("SettingsGeneralPage::decimalSeparator()")
DEBUG(" LOCALE: " << STDSTRING(locale.name()) << ',' << locale.language())
DEBUG(Q_FUNC_INFO << ", LOCALE: " << STDSTRING(locale.name()) << ',' << locale.language())
QChar decimalPoint{locale.decimalPoint()};
DEBUG(" SEPARATING CHAR: " << STDSTRING(QString(decimalPoint)) )
DEBUG(Q_FUNC_INFO << ", SEPARATING CHAR: " << STDSTRING(QString(decimalPoint)) )
if (decimalPoint == QChar('.'))
return DecimalSeparator::Dot;
else if (decimalPoint == QChar(','))
......@@ -72,10 +71,9 @@ SettingsGeneralPage::DecimalSeparator SettingsGeneralPage::decimalSeparator(QLoc
}
QLocale::Language SettingsGeneralPage::decimalSeparatorLocale() const {
DEBUG("SettingsGeneralPage::decimalSeparatorLocale()")
int currentIndex = ui.cbDecimalSeparator->currentIndex();
DEBUG(" SYSTEM LOCALE: " << STDSTRING(QLocale().name()) << ':' << QLocale().language())
DEBUG(" SYSTEM SEPARATING CHAR: " << STDSTRING(QString(QLocale().decimalPoint())) )
DEBUG(Q_FUNC_INFO << ", SYSTEM LOCALE: " << STDSTRING(QLocale().name()) << ':' << QLocale().language())
DEBUG(Q_FUNC_INFO << ", SYSTEM SEPARATING CHAR: " << STDSTRING(QString(QLocale().decimalPoint())) )
QChar groupSeparator{QLocale().groupSeparator()};
switch (currentIndex) {
......@@ -101,7 +99,7 @@ QLocale::Language SettingsGeneralPage::decimalSeparatorLocale() const {
}
void SettingsGeneralPage::applySettings() {
DEBUG("SettingsGeneralPage::applySettings()")
DEBUG(Q_FUNC_INFO)
if (!m_changed)
return;
......@@ -122,7 +120,6 @@ void SettingsGeneralPage::applySettings() {
}
void SettingsGeneralPage::restoreDefaults() {
DEBUG("SettingsGeneralPage::restoreDefaults()")
ui.cbLoadOnStart->setCurrentIndex(0);
ui.cbTitleBar->setCurrentIndex(0);
ui.cbInterface->setCurrentIndex(0);
......@@ -137,7 +134,6 @@ void SettingsGeneralPage::restoreDefaults() {
}
void SettingsGeneralPage::loadSettings() {
DEBUG("SettingsGeneralPage::loadSettings()")
const KConfigGroup group = KSharedConfig::openConfig()->group(QLatin1String("Settings_General"));
ui.cbLoadOnStart->setCurrentIndex(group.readEntry(QLatin1String("LoadOnStart"), 0));
ui.cbTitleBar->setCurrentIndex(group.readEntry(QLatin1String("TitleBar"), 0));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment