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
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)
LIST(APPEND CMAKE_PREFIX_PATH ${QT_DIR} ${MSYS})
@ -110,52 +108,18 @@ SET(PROJECT_SOURCES
${src}
)
# 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)
#WIN32
add_executable(${PROJECT_NAME} ${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")
add_executable(${PROJECT_NAME} WIN32 ${PROJECT_SOURCES} ${RCFILES} xsteam.rc)
#
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(
${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);
setAttribute(Qt::WA_TranslucentBackground);
setMouseTracking(true);
setBaseSize(700, 600);
resize(700, 600);
setBaseSize(800, 600);
resize(800, 600);
setLayout(m_layout);
}

View File

@ -315,7 +315,7 @@ void xsteam_data_unserialize()
_temp_data.m_time = x.value().at("Up_Time");
_temp_data.ico = x.value().at("Ico");
_temp_data.s_name = x.value().at("Src_Name");
if (x.value().contains("Manifest"))
{
_temp_data.manifest = x.value().at("Manifest").get<std::vector<std::string>>();
@ -527,7 +527,6 @@ bool xsteam_lua_to_com(UidData u_data)
m_cmd = nullptr;
std::cout << "lua_file exists:" << _lua_file.exists() << std::endl;
std::cout << "lua_packa_file exists:" << _lua_packa_file.exists() << std::endl;
/*
if (_lua_file.exists())
{
_lua_file.remove();
@ -536,7 +535,6 @@ bool xsteam_lua_to_com(UidData u_data)
{
_lua_packa_file.remove();
};
*/
return true;
}
void xsteam_run_steam_steamtools(RUN_MODE _mode)
@ -601,17 +599,17 @@ bool xsteam_steam_steamtools_exists(bool &steam_ok, bool &steamtools_ok)
}
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)
{
it = _data.u_data.erase(it);
QFile st(QString::fromStdString(_data.x_config.steamtools_st_dir + uid + ".st"));
if (st.exists())
{
st.remove();
}
xsteam_save_data_write();
_data.u_data.erase(it);
xsteam_save_data_write();
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);
u_data.i_time = (QDateTime::currentDateTime().toString("yyyy.MM.dd hh:mm:ss")).toStdString();
}
/*
if (QDir(vdf_dir).exists())
{
QDir(vdf_dir).removeRecursively();
}
*/
free_git_fetch();
emit signal_fetch_return_data(u_data);
return;

View File

@ -151,7 +151,7 @@ void xsteam_src_edit_ui::object_delete_src()
{
if (it->src_name == _name.toStdString())
{
it = _data.s_data.erase(it);
_data.s_data.erase(it);
modessl->removeRow(curRow);
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>();
xs_data.n_dlc.push_back(dlc_id.toStdString());
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()
@ -332,16 +332,13 @@ void xsteam_ui::slots_delete_uid_st()
{
QAbstractItemModel *modessl = ip_uid_table->model();
QModelIndex indextemp = modessl->index(curRow, 1);
QString uid = modessl->data(indextemp).value<QString>();
QString d_uid = modessl->data(indextemp).value<QString>();
modessl->removeRow(curRow);
ip_uid_table->setModel(modessl);
QFuture<void> future = QtConcurrent::run([=]()
{ xsteam_delete_uid_st(uid.toStdString()); });
QFuture<void> future = QtConcurrent::run([=](std::string _uid)
{ xsteam_delete_uid_st(_uid); }, d_uid.toStdString());
}
}
void xsteam_ui::slots_updata_uid_st()
{
}
void xsteam_ui::slots_fetch_src_data()
{
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)
{
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);
break;
}

View File

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