解决兼容性问题
This commit is contained in:
@ -673,6 +673,7 @@ bool SQLiteHelper::update_software()
|
||||
}
|
||||
else
|
||||
{
|
||||
public_programs_list[key].img.replace(QApplication::applicationDirPath(), "");
|
||||
sql = "insert into kmd_menu (sort,app_id,locked,type,category_id,name,orig_name,version,dev,create_time,use_time,op,func,path,url,status,is_navbar,is_elite) values "
|
||||
"(:sort,:app_id,:locked,:type,:category_id,:name,:orig_name,:version,:dev,:create_time,:use_time,:op,:func,:path,:url,:status,:is_navbar,:is_elite); ";
|
||||
query.prepare(sql);
|
||||
@ -760,13 +761,13 @@ bool SQLiteHelper::get_software(QList<ButtonStruct>* button_structs, ConfigRespo
|
||||
QSqlQuery query(db);
|
||||
QString sql = "select * from kmd_menu where is_navbar=1 order by sort,orig_name asc ;";
|
||||
|
||||
QString background_color;
|
||||
QString title_color;
|
||||
QString title_cover_color;
|
||||
QList<Button> buttons = config_response->buttons;
|
||||
if (config_response->succeed)
|
||||
{
|
||||
background_color = config_response->basic.backgroud_color;
|
||||
text_color = config_response->basic.title_color;
|
||||
title_color = config_response->basic.title_color;
|
||||
title_cover_color = config_response->basic.title_cover_color;
|
||||
|
||||
@ -791,11 +792,13 @@ bool SQLiteHelper::get_software(QList<ButtonStruct>* button_structs, ConfigRespo
|
||||
QJsonObject obj_basic=QJsonDocument::fromJson(obj_data.value("basic").toString().toUtf8()).object();
|
||||
background_color = obj_basic.value("backgroud_color").toString();
|
||||
title_color = obj_basic.value("title_color").toString();
|
||||
text_color = obj_basic.value("title_color").toString();
|
||||
title_cover_color = obj_basic.value("title_cover_color").toString();
|
||||
}
|
||||
else {
|
||||
background_color = DEFAULT_BACKGROUND_COLOR;
|
||||
title_color = DEFAULT_TEXT_COLOR;
|
||||
text_color = DEFAULT_TEXT_COLOR;
|
||||
title_cover_color = DEFAULT_COVER_COLOR;
|
||||
}
|
||||
}
|
||||
@ -920,8 +923,8 @@ bool SQLiteHelper::get_software(QList<ButtonStruct>* button_structs, ConfigRespo
|
||||
}else
|
||||
{
|
||||
insert_software(menu.name, menu.orig_name, "", QString::number(menu.sort),
|
||||
categories, QApplication::applicationDirPath() + DEFAULT_SVG_PATH + menu.img_name + ".svg",
|
||||
QApplication::applicationDirPath() + DEFAULT_PNG_PATH + menu.img_name + ".png", menu.type,
|
||||
categories, DEFAULT_SVG_PATH + menu.img_name + ".svg",
|
||||
DEFAULT_PNG_PATH + menu.img_name + ".png", menu.type,
|
||||
menu.locked, menu.op, menu.func, menu.url, menu.is_navbar, menu.is_elite, menu.dev);
|
||||
}
|
||||
|
||||
@ -1008,7 +1011,15 @@ bool SQLiteHelper::get_software(QList<ButtonStruct>* button_structs, ConfigRespo
|
||||
delete render_image_cover;
|
||||
}
|
||||
}
|
||||
button_struct.png = new QImage(query.value("png").toString());
|
||||
QFile png(QApplication::applicationDirPath() + query.value("img").toString());
|
||||
if(png.exists())
|
||||
{
|
||||
button_struct.png = new QImage(QApplication::applicationDirPath() + query.value("img").toString());
|
||||
}else
|
||||
{
|
||||
button_struct.png = new QImage(QApplication::applicationDirPath()+DEFAULT_PNG);
|
||||
}
|
||||
|
||||
button_struct.image = image;
|
||||
button_struct.image_cover = image_cover;
|
||||
button_struct.background_color = background_color;
|
||||
@ -1102,7 +1113,15 @@ bool SQLiteHelper::get_software(QList<ButtonStruct>* button_structs,QString back
|
||||
delete render_image_cover;
|
||||
}
|
||||
}
|
||||
button_struct.png = new QImage(query.value("png").toString());
|
||||
QFile png(QApplication::applicationDirPath() + query.value("img").toString());
|
||||
if (png.exists())
|
||||
{
|
||||
button_struct.png = new QImage(QApplication::applicationDirPath() + query.value("img").toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
button_struct.png = new QImage(QApplication::applicationDirPath() + DEFAULT_PNG);
|
||||
}
|
||||
button_struct.image = image;
|
||||
button_struct.image_cover = image_cover;
|
||||
button_struct.background_color = background_color;
|
||||
@ -1444,7 +1463,7 @@ bool SQLiteHelper::get_all_software(QList<Record> &softwares,int category)
|
||||
record.id = query.value("id").toInt();
|
||||
record.logo=query.value("logo").toString();
|
||||
record.is_navbar=query.value("is_navbar").toBool();
|
||||
record.img = query.value("img").toString();
|
||||
record.img = QApplication::applicationDirPath()+query.value("img").toString();
|
||||
record.sort = query.value("sort").toInt();
|
||||
record.app_id = query.value("app_id").toString();
|
||||
record.locked = query.value("locked").toBool();
|
||||
|
Reference in New Issue
Block a user