1-修复删除入库信息BUG问题

2-修复源删除BUG
This commit is contained in:
JackLee_CN 2024-10-15 18:39:14 +08:00
parent 6c8b430f77
commit c2abae6119
7 changed files with 16 additions and 59 deletions

View File

@ -44,8 +44,6 @@ endif()
#QT .cmake #QT .cmake
#QT #QT
SET(QT_DIR "D:/Dev/Qt/6.8.0/mingw1310_static_x64/lib/cmake") SET(QT_DIR "D:/Dev/Qt/6.8.0/mingw1310_static_x64/lib/cmake")
#Msys2
#SET(QT_DIR "D:/Dev/msys64/mingw64/qt6-static/lib/cmake")
SET(JSON ${PROJECT_SOURCE_DIR}/3rdparty/json) SET(JSON ${PROJECT_SOURCE_DIR}/3rdparty/json)
LIST(APPEND CMAKE_PREFIX_PATH ${QT_DIR} ${MSYS}) LIST(APPEND CMAKE_PREFIX_PATH ${QT_DIR} ${MSYS})
@ -110,52 +108,18 @@ SET(PROJECT_SOURCES
${src} ${src}
) )
# qFatalqDebug # qFatalqDebug
#LIST(APPEND CMAKE_CXX_FLAGS "-DQT_NO_DEBUG_OUTPUT") LIST(APPEND CMAKE_CXX_FLAGS "-DQT_NO_DEBUG_OUTPUT")
# #
QT6_ADD_RESOURCES(RCFILES res.qrc) QT6_ADD_RESOURCES(RCFILES res.qrc)
#WIN32 #WIN32
add_executable(${PROJECT_NAME} ${PROJECT_SOURCES} ${RCFILES} xsteam.rc) add_executable(${PROJECT_NAME} WIN32 ${PROJECT_SOURCES} ${RCFILES} xsteam.rc)
#
#RPATH
SET(CMAKE_SKIP_RPATH TRUE)
#
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong")
#GOT
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,relro,-z,now")
SET(CMAKE_EXECUTABLE_LINKER_FLAGS "${CMAKE_EXECUTABLE_LINKER_FLAGS} -Wl,-z,relro,-z,now")
#
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,noexecstack")
SET(CMAKE_EXECUTABLE_LINKER_FLAGS "${CMAKE_EXECUTABLE_LINKER_FLAGS} -Wl,-z,noexecstack")
#
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpic")
#
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpie")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pie")
SET(CMAKE_EXECUTABLE_LINKER_FLAGS "${CMAKE_EXECUTABLE_LINKER_FLAGS} -pie")
#
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fvisibility=hidden")
SET(CMAKE_EXECUTABLE_LINKER_FLAGS "${CMAKE_EXECUTABLE_LINKER_FLAGS} -fvisibility=hidden")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fvisibility-inlines-hidden")
SET(CMAKE_EXECUTABLE_LINKER_FLAGS "${CMAKE_EXECUTABLE_LINKER_FLAGS} -fvisibility-inlines-hidden")
#
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -s")
SET(CMAKE_EXECUTABLE_LINKER_FLAGS "${CMAKE_EXECUTABLE_LINKER_FLAGS} -s")
#EXE
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s")
#
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -ftrapv")
#
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -fstack-check")
# #
target_link_options(${PROJECT_NAME} PUBLIC -Wl,--allow-multiple-definition) target_link_options(${PROJECT_NAME} PUBLIC -Wl,--allow-multiple-definition)
# #
#SET(CMAKE_EXE_LINKER_FLAGS -static) SET(CMAKE_EXE_LINKER_FLAGS -static)
#set_property(TARGET harfbuzz::harfbuzz PROPERTY
# IMPORTED_IMPLIB "D:/Dev/msys64/mingw64/lib/libharfbuzz.dll.a" )
target_link_libraries( target_link_libraries(
${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Gui Qt6::Widgets PkgConfig::LIBGIT2 PkgConfig::CURL ${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Gui Qt6::Widgets PkgConfig::LIBGIT2 PkgConfig::CURL
) )

View File

@ -27,8 +27,8 @@ void sui::init_layout()
setWindowFlags(Qt::FramelessWindowHint); setWindowFlags(Qt::FramelessWindowHint);
setAttribute(Qt::WA_TranslucentBackground); setAttribute(Qt::WA_TranslucentBackground);
setMouseTracking(true); setMouseTracking(true);
setBaseSize(700, 600); setBaseSize(800, 600);
resize(700, 600); resize(800, 600);
setLayout(m_layout); setLayout(m_layout);
} }

View File

@ -527,7 +527,6 @@ bool xsteam_lua_to_com(UidData u_data)
m_cmd = nullptr; m_cmd = nullptr;
std::cout << "lua_file exists:" << _lua_file.exists() << std::endl; std::cout << "lua_file exists:" << _lua_file.exists() << std::endl;
std::cout << "lua_packa_file exists:" << _lua_packa_file.exists() << std::endl; std::cout << "lua_packa_file exists:" << _lua_packa_file.exists() << std::endl;
/*
if (_lua_file.exists()) if (_lua_file.exists())
{ {
_lua_file.remove(); _lua_file.remove();
@ -536,7 +535,6 @@ bool xsteam_lua_to_com(UidData u_data)
{ {
_lua_packa_file.remove(); _lua_packa_file.remove();
}; };
*/
return true; return true;
} }
void xsteam_run_steam_steamtools(RUN_MODE _mode) void xsteam_run_steam_steamtools(RUN_MODE _mode)
@ -601,16 +599,16 @@ bool xsteam_steam_steamtools_exists(bool &steam_ok, bool &steamtools_ok)
} }
void xsteam_delete_uid_st(std::string uid) void xsteam_delete_uid_st(std::string uid)
{ {
for (auto it = _data.u_data.begin(); it != _data.u_data.end();) for (auto it = _data.u_data.begin(); it != _data.u_data.end(); ++it)
{ {
if (it->uid == uid) if (it->uid == uid)
{ {
it = _data.u_data.erase(it);
QFile st(QString::fromStdString(_data.x_config.steamtools_st_dir + uid + ".st")); QFile st(QString::fromStdString(_data.x_config.steamtools_st_dir + uid + ".st"));
if (st.exists()) if (st.exists())
{ {
st.remove(); st.remove();
} }
_data.u_data.erase(it);
xsteam_save_data_write(); xsteam_save_data_write();
break; break;
} }

View File

@ -125,12 +125,10 @@ void xsteam_git_fetch::fecth_uid_to_steam(UidData &u_data)
xsteam_vdf_write(vdf_config_file, vdf_data); xsteam_vdf_write(vdf_config_file, vdf_data);
u_data.i_time = (QDateTime::currentDateTime().toString("yyyy.MM.dd hh:mm:ss")).toStdString(); u_data.i_time = (QDateTime::currentDateTime().toString("yyyy.MM.dd hh:mm:ss")).toStdString();
} }
/*
if (QDir(vdf_dir).exists()) if (QDir(vdf_dir).exists())
{ {
QDir(vdf_dir).removeRecursively(); QDir(vdf_dir).removeRecursively();
} }
*/
free_git_fetch(); free_git_fetch();
emit signal_fetch_return_data(u_data); emit signal_fetch_return_data(u_data);
return; return;

View File

@ -151,7 +151,7 @@ void xsteam_src_edit_ui::object_delete_src()
{ {
if (it->src_name == _name.toStdString()) if (it->src_name == _name.toStdString())
{ {
it = _data.s_data.erase(it); _data.s_data.erase(it);
modessl->removeRow(curRow); modessl->removeRow(curRow);
m_Table->setModel(modessl); m_Table->setModel(modessl);
} }

View File

@ -322,7 +322,7 @@ void xsteam_ui::slots_in_dlc_add()
QString dlc_id = modessl->data(indextemp).value<QString>(); QString dlc_id = modessl->data(indextemp).value<QString>();
xs_data.n_dlc.push_back(dlc_id.toStdString()); xs_data.n_dlc.push_back(dlc_id.toStdString());
ip_in_dlc_table->item_append(xs_data, VIEW_MODE::IN_DLC_INFO); ip_in_dlc_table->item_append(xs_data, VIEW_MODE::IN_DLC_INFO);
slots_msg_text("增加:" + dlc_id.toStdString() + "成功!"); slots_msg_text("增加DLC:" + dlc_id.toStdString() + "成功!");
} }
} }
void xsteam_ui::slots_delete_uid_st() void xsteam_ui::slots_delete_uid_st()
@ -332,16 +332,13 @@ void xsteam_ui::slots_delete_uid_st()
{ {
QAbstractItemModel *modessl = ip_uid_table->model(); QAbstractItemModel *modessl = ip_uid_table->model();
QModelIndex indextemp = modessl->index(curRow, 1); QModelIndex indextemp = modessl->index(curRow, 1);
QString uid = modessl->data(indextemp).value<QString>(); QString d_uid = modessl->data(indextemp).value<QString>();
modessl->removeRow(curRow); modessl->removeRow(curRow);
ip_uid_table->setModel(modessl); ip_uid_table->setModel(modessl);
QFuture<void> future = QtConcurrent::run([=]() QFuture<void> future = QtConcurrent::run([=](std::string _uid)
{ xsteam_delete_uid_st(uid.toStdString()); }); { xsteam_delete_uid_st(_uid); }, d_uid.toStdString());
} }
} }
void xsteam_ui::slots_updata_uid_st()
{
}
void xsteam_ui::slots_fetch_src_data() void xsteam_ui::slots_fetch_src_data()
{ {
slots_msg_text("正在拉取" + server_txt->currentText().toStdString() + "数据..."); slots_msg_text("正在拉取" + server_txt->currentText().toStdString() + "数据...");
@ -379,7 +376,8 @@ void xsteam_ui::slots_selection_row(const QItemSelection &current, const QItemSe
for (int i = 0; i < server_txt->count(); ++i) for (int i = 0; i < server_txt->count(); ++i)
{ {
std::string item_str = server_txt->itemText(i).toStdString(); std::string item_str = server_txt->itemText(i).toStdString();
if(xs_data.s_name==item_str){ if (xs_data.s_name == item_str)
{
server_txt->setCurrentIndex(i); server_txt->setCurrentIndex(i);
break; break;
} }

View File

@ -98,7 +98,6 @@ private slots:
void slots_fetch_src_data(); void slots_fetch_src_data();
void slots_rightMenu(const QPoint &pos); void slots_rightMenu(const QPoint &pos);
void slots_delete_uid_st(); void slots_delete_uid_st();
void slots_updata_uid_st();
void slots_get_uid_dlcs(); void slots_get_uid_dlcs();
void slots_in_dlc_delete(); void slots_in_dlc_delete();
void slots_in_dlc_add(); void slots_in_dlc_add();