mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 06:15:26 +00:00
Random small whitespace cleanups
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
0f5664e584
commit
9a0e40b456
2 changed files with 20 additions and 20 deletions
|
@ -221,9 +221,9 @@ void ProfileWidget2::setupItemOnScene()
|
|||
|
||||
void ProfileWidget2::replot()
|
||||
{
|
||||
int diveId = dataModel->id();
|
||||
dataModel->clear();
|
||||
plotDives(QList<dive *>() << getDiveById(diveId));
|
||||
int diveId = dataModel->id();
|
||||
dataModel->clear();
|
||||
plotDives(QList<dive *>() << getDiveById(diveId));
|
||||
}
|
||||
|
||||
void ProfileWidget2::setupItemSizes()
|
||||
|
@ -333,11 +333,11 @@ void ProfileWidget2::plotDives(QList<dive *> dives)
|
|||
return;
|
||||
|
||||
int animSpeedBackup = -1;
|
||||
if(firstCall && MainWindow::instance()->filesFromCommandLine()){
|
||||
if (firstCall && MainWindow::instance()->filesFromCommandLine()) {
|
||||
QSettings s;
|
||||
s.beginGroup("Animations");
|
||||
animSpeedBackup = s.value("animation_speed",500).toInt();
|
||||
s.setValue("animation_speed",0);
|
||||
animSpeedBackup = s.value("animation_speed", 500).toInt();
|
||||
s.setValue("animation_speed", 0);
|
||||
firstCall = false;
|
||||
}
|
||||
|
||||
|
@ -462,10 +462,10 @@ void ProfileWidget2::plotDives(QList<dive *> dives)
|
|||
// qDebug() << event->getEvent()->name << "@" << event->getEvent()->time.seconds << "is hidden:" << event->isHidden();
|
||||
}
|
||||
diveComputerText->setText(currentdc->model);
|
||||
if (MainWindow::instance()->filesFromCommandLine() && animSpeedBackup != -1){
|
||||
if (MainWindow::instance()->filesFromCommandLine() && animSpeedBackup != -1) {
|
||||
QSettings s;
|
||||
s.beginGroup("Animations");
|
||||
s.setValue("animation_speed",animSpeedBackup);
|
||||
s.setValue("animation_speed", animSpeedBackup);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -710,7 +710,7 @@ void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event)
|
|||
action->setData(QVariant::fromValue<void *>(item));
|
||||
connect(action, SIGNAL(triggered(bool)), this, SLOT(hideEvents()));
|
||||
m.addAction(action);
|
||||
if(item->getEvent()->type == SAMPLE_EVENT_BOOKMARK){
|
||||
if (item->getEvent()->type == SAMPLE_EVENT_BOOKMARK) {
|
||||
action = new QAction(&m);
|
||||
action->setText(tr("Edit name"));
|
||||
action->setData(QVariant::fromValue<void *>(item));
|
||||
|
@ -769,8 +769,8 @@ void ProfileWidget2::removeEvent()
|
|||
struct event *event = item->getEvent();
|
||||
|
||||
if (QMessageBox::question(MainWindow::instance(), TITLE_OR_TEXT(
|
||||
tr("Remove the selected event?"),
|
||||
tr("%1 @ %2:%3").arg(event->name).arg(event->time.seconds / 60).arg(event->time.seconds % 60, 2, 10, QChar('0'))),
|
||||
tr("Remove the selected event?"),
|
||||
tr("%1 @ %2:%3").arg(event->name).arg(event->time.seconds / 60).arg(event->time.seconds % 60, 2, 10, QChar('0'))),
|
||||
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) {
|
||||
struct event **ep = ¤t_dc->events;
|
||||
while (ep && *ep != event)
|
||||
|
@ -828,14 +828,14 @@ void ProfileWidget2::editName()
|
|||
QString newName = QInputDialog::getText(MainWindow::instance(), tr("Edit name of bookmark"),
|
||||
tr("Custom name:"), QLineEdit::Normal,
|
||||
event->name, &ok);
|
||||
if(ok && !newName.isEmpty()){
|
||||
if(newName.length() > 22){//longer names will display as garbage.
|
||||
if (ok && !newName.isEmpty()) {
|
||||
if (newName.length() > 22) { //longer names will display as garbage.
|
||||
QMessageBox lengthWarning;
|
||||
lengthWarning.setText("Name is too long!");
|
||||
lengthWarning.exec();
|
||||
return;
|
||||
}
|
||||
const char* temp;
|
||||
const char *temp;
|
||||
temp = newName.toStdString().c_str();
|
||||
strcpy(event->name, temp);
|
||||
remember_event(temp);
|
||||
|
|
|
@ -17,8 +17,8 @@ void put_HTML_date(struct membuffer *b, struct dive *dive)
|
|||
{
|
||||
struct tm tm;
|
||||
utc_mkdate(dive->when, &tm);
|
||||
put_format(b, "<p>date=%04u-%02u-%02u</p>",tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday);
|
||||
put_format(b, "<p>time=%02u:%02u:%02u</p>",tm.tm_hour, tm.tm_min, tm.tm_sec);
|
||||
put_format(b, "<p>date=%04u-%02u-%02u</p>", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday);
|
||||
put_format(b, "<p>time=%02u:%02u:%02u</p>", tm.tm_hour, tm.tm_min, tm.tm_sec);
|
||||
}
|
||||
|
||||
void put_HTML_temp(struct membuffer *b, struct dive *dive)
|
||||
|
@ -78,7 +78,7 @@ void put_HTML_notes(struct membuffer *b, struct dive *dive)
|
|||
{
|
||||
if (dive->notes) {
|
||||
char *notes = quote(dive->notes);
|
||||
put_format(b,"<p>Notes : %s </p>", notes);
|
||||
put_format(b, "<p>Notes : %s </p>", notes);
|
||||
free(notes);
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ void writeMarkers(struct membuffer *b)
|
|||
continue;
|
||||
|
||||
put_format(b, "temp = new google.maps.Marker({position: new google.maps.LatLng(%f,%f)});\n",
|
||||
dive->latitude.udeg/1000000.0, dive->longitude.udeg/1000000.0);
|
||||
dive->latitude.udeg / 1000000.0, dive->longitude.udeg / 1000000.0);
|
||||
put_string(b, "markers.push(temp);\ntempinfowindow = new google.maps.InfoWindow({content: '<div id=\"content\">'+'<div id=\"siteNotice\">'+'</div>'+'<div id=\"bodyContent\">");
|
||||
put_HTML_date(b, dive);
|
||||
put_duration(b, dive->duration, "<p>duration=", " min</p>");
|
||||
|
@ -109,8 +109,8 @@ void writeMarkers(struct membuffer *b)
|
|||
|
||||
void insert_html_header(struct membuffer *b)
|
||||
{
|
||||
put_string(b,"<!DOCTYPE html>\n<html>\n<head>\n");
|
||||
put_string(b,"<meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\" />\n<title>World Map</title>\n");
|
||||
put_string(b, "<!DOCTYPE html>\n<html>\n<head>\n");
|
||||
put_string(b, "<meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\" />\n<title>World Map</title>\n");
|
||||
}
|
||||
|
||||
void insert_css(struct membuffer *b)
|
||||
|
|
Loading…
Add table
Reference in a new issue