Browse files

add nosync compile flag

Signed-off-by: xiehuc <xiehuc@gmail.com>
  • Loading branch information...
1 parent 98cc32e commit b1654cccc6bf70c4fcbc45a3577d954d725a901c @xiehuc committed Feb 17, 2013
Showing with 28 additions and 27 deletions.
  1. +6 −4 CMakeLists.txt
  2. +7 −15 README.md
  3. +11 −8 src/CMakeLists.txt
  4. +4 −0 src/webqq.c
View
10 CMakeLists.txt
@@ -33,11 +33,13 @@ if(NLS)
find_package(Gettext)
endif(NLS)
-option(WITH_LIBEV "build in libev for async process" On)
+#option(WITH_LIBEV "build in libev for async process" On)
-if(WITH_LIBEV)
- find_package(EV REQUIRED)
-endif(WITH_LIBEV)
+#if(WITH_LIBEV)
+find_package(EV REQUIRED)
+#endif(WITH_LIBEV)
+
+option(DB_NOSYNC "Open Sqlite3 NoSync Pragma,for db build without block UI" Off)
if(VERBOSE)
add_definitions(-DLWQQ_VERBOSE_LEVEL=${VERBOSE})
View
22 README.md
@@ -30,10 +30,8 @@ Build Option
- UOA[=Off]
> Ubuntu-Account-Online Support
-- WITH_LIBEV[=On]
-> enable libev .
- put all http io waiting to libev thread.
- avoid block main ui thread. so would be smoothly.
+- DB_NOSYNC[=Off]
+> Enable sqlite3 nosync pragma, when first run build db.would not block ui
- VERBOSE[=0]
> set the verbose level .0 means no verbose,3 means max verbose.
@@ -109,24 +107,18 @@ lwqq 即是 linux webqq 之意
### 编译选项
- UOA[=Off]
-> Ubuntu-Account-Online Support
+> 编译对Ubuntu-Account-Online的支持
-- WITH_LIBEV[=On]
-> enable libev .
- put all http io waiting to libev thread.
- avoid block main ui thread. so would be smoothly.
+- DB_NOSYNC[=Off]
+> 开启sqlite3不同步的选项.当第一次运行建立数据库时,能够提供更好的体验不卡ui.
-将全部的http io等待放到一个单独的线程中.
-避免卡UI线程.能够提高程序的响应和体验.
+- VERBOSE[=0]
+> 设置输出等级 .0表示没有输出,3表示最大输出.
- cmake .. -DWITH_LIBEV=On
- make
- sudo make install
功能列表
--------
-
### pidgin
* 支持发送接受 好友|群|讨论组 消息
View
19 src/CMakeLists.txt
@@ -4,7 +4,6 @@ set(SRC_LIST
translate.c
qq_types.c
ft.c
- remote.c
)
set(LWQQ_LIST
@@ -38,13 +37,17 @@ include_directories(
${GLIB_INCLUDE_DIRS}
liblwqq)
-if(WITH_LIBEV)
- add_definitions(-DUSE_LIBEV)
- include_directories(${EV_INCLUDE_DIRS})
- target_link_libraries(webqq ${EV_LIBRARIES})
-else(WITH_LIBEV)
- add_definitions(-DUSE_LIBPURPLE)
-endif(WITH_LIBEV)
+#if(WITH_LIBEV)
+add_definitions(-DUSE_LIBEV)
+include_directories(${EV_INCLUDE_DIRS})
+target_link_libraries(webqq ${EV_LIBRARIES})
+#else(WITH_LIBEV)
+#add_definitions(-DUSE_LIBPURPLE)
+#endif(WITH_LIBEV)
+
+if(DB_NOSYNC)
+ add_definitions(-DNOSYNC)
+endif(DB_NOSYNC)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DUSE_DEBUG=1 -Wno-unused-function")
View
4 src/webqq.c
@@ -1751,7 +1751,11 @@ static void qq_login(PurpleAccount *account)
ac->debug_file_send = purple_account_get_bool(account,"debug_file_send",FALSE);
char db_path[64]={0};
snprintf(db_path,sizeof(db_path),"%s/.config/lwqq",getenv("HOME"));
+#ifdef NOSYNC
ac->db = lwdb_userdb_new(username,db_path,LWDB_SYNCHRONOUS_OFF);
+#else
+ ac->db = lwdb_userdb_new(username,db_path,0);
+#endif
ac->qq_use_qqnum = ! purple_account_get_bool(account, "disable_qq_cache", FALSE);
//for empathy
if(ac->qq_use_qqnum)

0 comments on commit b1654cc

Please sign in to comment.