diff options
author | Saturneric <[email protected]> | 2023-02-03 13:43:55 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2023-02-03 13:43:55 +0000 |
commit | 11d32517c2f6f538209c893c6b0b24572fba1a36 (patch) | |
tree | 0dac14bcad75d9c7c5b5723dc23e6409721966b4 /src/ui/widgets/FilePage.cpp | |
parent | feat: change logging framework to spdlog (diff) | |
download | GpgFrontend-11d32517c2f6f538209c893c6b0b24572fba1a36.tar.gz GpgFrontend-11d32517c2f6f538209c893c6b0b24572fba1a36.zip |
feat: change the log style in source files
Diffstat (limited to '')
-rw-r--r-- | src/ui/widgets/FilePage.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/ui/widgets/FilePage.cpp b/src/ui/widgets/FilePage.cpp index fe188e93..98b46467 100644 --- a/src/ui/widgets/FilePage.cpp +++ b/src/ui/widgets/FilePage.cpp @@ -108,7 +108,7 @@ void FilePage::slot_file_tree_view_item_clicked(const QModelIndex& index) { #endif m_path_ = selected_path_; - LOG(INFO) << "selected path" << selected_path_.u8string(); + SPDLOG_INFO("selected path: {}", selected_path_.u8string()); selected_path_ = std::filesystem::path(selected_path_); MainWindow::CryptoMenu::OperationType operation_type = @@ -164,10 +164,10 @@ void FilePage::slot_up_level() { std::filesystem::path path_obj(str_path); m_path_ = path_obj; - LOG(INFO) << "get path" << m_path_; + SPDLOG_INFO("get path: {}", m_path_.u8string()); if (m_path_.has_parent_path() && !m_path_.parent_path().empty()) { m_path_ = m_path_.parent_path(); - LOG(INFO) << "parent path" << m_path_; + SPDLOG_INFO("parent path: {}", m_path_.u8string()); ui_->pathEdit->setText(m_path_.u8string().c_str()); this->SlotGoPath(); } @@ -204,7 +204,7 @@ void FilePage::SlotGoPath() { m_path_ = std::filesystem::path(fileInfo.filePath().toStdString()); #endif - LOG(INFO) << "set path" << m_path_.u8string(); + SPDLOG_INFO("set path: {}", m_path_.u8string()); ui_->fileTreeView->setRootIndex(dir_model_->index(fileInfo.filePath())); dir_model_->setRootPath(fileInfo.filePath()); for (int i = 1; i < dir_model_->columnCount(); ++i) { @@ -267,7 +267,7 @@ void FilePage::create_popup_menu() { auto showHiddenAct = new QAction(_("Show Hidden File"), this); showHiddenAct->setCheckable(true); connect(showHiddenAct, &QAction::triggered, this, [&](bool checked) { - LOG(INFO) << "Set Hidden" << checked; + SPDLOG_INFO("set hidden: {}", checked); if (checked) dir_model_->setFilter(dir_model_->filter() | QDir::Hidden); else @@ -279,7 +279,7 @@ void FilePage::create_popup_menu() { auto showSystemAct = new QAction(_("Show System File"), this); showSystemAct->setCheckable(true); connect(showSystemAct, &QAction::triggered, this, [&](bool checked) { - LOG(INFO) << "Set Hidden" << checked; + SPDLOG_INFO("set hidden: {}", checked); if (checked) dir_model_->setFilter(dir_model_->filter() | QDir::System); else @@ -291,7 +291,7 @@ void FilePage::create_popup_menu() { void FilePage::onCustomContextMenu(const QPoint& point) { QModelIndex index = ui_->fileTreeView->indexAt(point); - LOG(INFO) << "right click" << selected_path_.u8string(); + SPDLOG_INFO("right click: {}", selected_path_.u8string()); #ifdef WINDOWS auto index_dir_str = @@ -328,7 +328,7 @@ void FilePage::slot_open_item() { if (info.isDir()) { if (info.isReadable() && info.isExecutable()) { const auto file_path = info.filePath().toUtf8().toStdString(); - LOG(INFO) << "set path" << file_path; + SPDLOG_INFO("set path: {}", file_path); ui_->pathEdit->setText(info.filePath().toUtf8()); SlotGoPath(); } else { @@ -340,7 +340,7 @@ void FilePage::slot_open_item() { // handle normal text or binary file auto main_window = qobject_cast<MainWindow*>(first_parent_); auto qt_open_path = QString::fromStdString(selected_path_.u8string()); - LOG(INFO) << "open item" << qt_open_path.toStdString(); + SPDLOG_INFO("open item: {}", qt_open_path.toStdString()); if (main_window != nullptr) main_window->SlotOpenFile(qt_open_path); } else { QMessageBox::critical(this, _("Error"), @@ -365,12 +365,12 @@ void FilePage::slot_rename_item() { #else new_name_path /= text.toStdString(); #endif - LOG(INFO) << "new name path" << new_name_path; + SPDLOG_INFO("new name path: {}", new_name_path.u8string()); std::filesystem::rename(old_name_path, new_name_path); // refresh this->SlotGoPath(); } catch (...) { - LOG(ERROR) << "rename error" << new_name_path; + SPDLOG_ERROR("rename error: {}", new_name_path.u8string()); QMessageBox::critical(this, _("Error"), _("Unable to rename the file or folder.")); } @@ -387,7 +387,7 @@ void FilePage::slot_delete_item() { if (ret == QMessageBox::Cancel) return; - LOG(INFO) << "Delete Item" << data.toString().toStdString(); + SPDLOG_INFO("delete item: {}", data.toString().toStdString()); if (!dir_model_->remove(index)) { QMessageBox::critical(this, _("Error"), @@ -441,7 +441,7 @@ void FilePage::slot_create_empty_file() { } void FilePage::keyPressEvent(QKeyEvent* event) { - LOG(INFO) << "Key Press" << event->key(); + SPDLOG_INFO("key press: {}", event->key()); if (ui_->pathEdit->hasFocus() && (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter)) { SlotGoPath(); |