src/EditProductTab13.cpp

changeset 476
29487eac1183
parent 475
895c5ae1dab1
equal deleted inserted replaced
475:895c5ae1dab1 476:29487eac1183
363 qWarning() << "Failed to modify modify time!"; 363 qWarning() << "Failed to modify modify time!";
364 } 364 }
365 if (!file.setFileTime(product->images_list.at(ui->filmStrip->currentRow()).timestamp, QFileDevice::FileAccessTime)) { 365 if (!file.setFileTime(product->images_list.at(ui->filmStrip->currentRow()).timestamp, QFileDevice::FileAccessTime)) {
366 qWarning() << "Failed to modify access time!"; 366 qWarning() << "Failed to modify access time!";
367 } 367 }
368 // if (!file.setFileTime(product->images_list.at(ui->filmStrip->currentRow()).timestamp, QFileDevice::FileBirthTime)) {
369 // qDebug() << "Failed to modify create time!";
370 // }
371 file.close(); 368 file.close();
372 QMessageBox::information(this, tr("Save File"), tr("Saved %1").arg(product->images_list.at(ui->filmStrip->currentRow()).filename)); 369 QMessageBox::information(this, tr("Save File"), tr("Saved %1").arg(product->images_list.at(ui->filmStrip->currentRow()).filename));
373 } 370 }
374 371
375 372
421 418
422 qDebug() << "piccomment_changed" << ui->image_commentEdit->text(); 419 qDebug() << "piccomment_changed" << ui->image_commentEdit->text();
423 product->images_list[ui->filmStrip->currentRow()].pic_comment = ui->image_commentEdit->text(); 420 product->images_list[ui->filmStrip->currentRow()].pic_comment = ui->image_commentEdit->text();
424 421
425 QSqlQuery query; 422 QSqlQuery query;
426 qDebug() << "piccomment_changed 0";
427 query.prepare("UPDATE products_pics SET pic_comment=:pic_comment WHERE record=:record"); 423 query.prepare("UPDATE products_pics SET pic_comment=:pic_comment WHERE record=:record");
428 query.bindValue(":pic_comment", ui->image_commentEdit->text()); 424 query.bindValue(":pic_comment", ui->image_commentEdit->text());
429 query.bindValue(":record", product->images_list.at(ui->filmStrip->currentRow()).record); 425 query.bindValue(":record", product->images_list.at(ui->filmStrip->currentRow()).record);
430 query.exec(); 426 query.exec();
431 427
432 if (query.lastError().isValid()) { 428 if (query.lastError().isValid()) {
433 qWarning() << "pictype_changed()" << query.lastError(); 429 qWarning() << "pictype_changed()" << query.lastError();
434 QMessageBox::warning(this, tr("Database error"), tr("MySQL error: %1\n%2\n%3") 430 QMessageBox::warning(this, tr("Database error"), tr("MySQL error: %1\n%2\n%3")
435 .arg(query.lastError().nativeErrorCode()).arg(query.lastError().driverText()).arg(query.lastError().databaseText())); 431 .arg(query.lastError().nativeErrorCode()).arg(query.lastError().driverText()).arg(query.lastError().databaseText()));
436 } 432 }
437 qDebug() << "piccomment_changed 3"; 433 }
438 } 434
439 435
440

mercurial