03-save-data-per-user.diff 存在的若干问题
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Chinese-calendar |
Fix Released
|
High
|
Abel Liu |
Bug Description
chinese-calendar 0.7.6-0ubuntu4中
1、获取用户家目录的方式
现在的做法是从环境变量中取得用
这么做有个大问题,
2、数据库文件存放的目录
放到家目录下"
3、复制数据库的问题
现在是通过system(
=======
我另外写了个03-
1&2、直接用内建的QDesk
3、用QDir和QFile提供
Changed in chinese-calendar: | |
importance: | Undecided → High |
assignee: | nobody → Abel Liu (guiltyritter) |
Changed in chinese-calendar: | |
status: | New → In Progress |
Changed in chinese-calendar: | |
milestone: | none → 0.7.6 |
Changed in chinese-calendar: | |
status: | In Progress → Fix Committed |
Changed in chinese-calendar: | |
status: | Fix Committed → Fix Released |
对了,QDesktopServ ices::storageLo cation方法是2008年发 布的Qt 4.4引入的, 如果有意支持更早版本的Qt库, 或者要放到$HOME/ .local/ share或$ HOME/.config下, 可以用以下的方法
QStringList env = QProcess: :systemEnvironm ent().filter( QRegExp( "^XDG_DATA_ HOME=") );
systemdirector y = QDir::homePath() + "/.local/share";
systemdirector y = env.at(0);
systemdirector y = systemdirectory .mid(systemdire ctory.indexOf( "=") + 1); y.isEmpty( )) {
systemdire ctory = QDir::homePath() + "/.local/share";
if (env.length() == 0) {
} else {
if (systemdirector
}
}