Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

archlinux 上 launcher 按分类显示内容为空 #24

Closed
fasheng opened this issue Jan 19, 2016 · 18 comments
Closed

archlinux 上 launcher 按分类显示内容为空 #24

fasheng opened this issue Jan 19, 2016 · 18 comments

Comments

@fasheng
Copy link
Contributor

fasheng commented Jan 19, 2016

记得上次小强修复过 archlinux 上 launcher 图标为空的问题,当时是由于引入 lastore 的新接口导致的,估计这次的原因类似。

@linuxdeepin/li-liqiang @dragondjf 看下好不好处理。

martyr-deepin/arch-deepin#223

@fasheng
Copy link
Contributor Author

fasheng commented Jan 19, 2016

capturadeepin20160119012557

@kosl90
Copy link

kosl90 commented Jan 19, 2016

@dragondjf 我测试了一下,不知道前端是什么情况,后端似乎没什么问题,把/var/lib/lastore/categories.json删除后可以重现,你找时间看看吧

@fasheng
Copy link
Contributor Author

fasheng commented Jan 26, 2016

经调试发现,archlinux 上后端 DBus 接口 GetAllCategoryInfos 返回的 category 以小写字母开头,而 Deepin 上则为大写字母,如

[('development', 2L, ['ipython3', 'd-feet', 'xoo', 'ipython']),
('reading', 3L, []),
('game', 5L, [])]

前端则是直接定义的常量
https://github.com/linuxdeepin/dde-launcher/blob/master/app/global.h#L22

@kosl90
Copy link

kosl90 commented Jan 27, 2016

不应该是这个原因,不论是有没有我说的那个文件,返回的都是全小写的

@fasheng
Copy link
Contributor Author

fasheng commented Jan 27, 2016

确实是大小写的问题,我把前端的 CategoryKeys 改为全小写后正常

const QStringList CategroyKeys{
    "internet",
    "chat",
    "music",
    "video",
    "graphics",
    "game",
    "office",
    "reading",
    "development",
    "system",
    "others"
};

@sbwtw
Copy link

sbwtw commented Jan 27, 2016

那这个很容易处理呀,比较的时候ignore case就行了

@fasheng
Copy link
Contributor Author

fasheng commented Jan 27, 2016

建议前后端均使用小写,否则前端有多处代码要处理 CategroyKeys 大小写问题,容易遗漏。

@kosl90
Copy link

kosl90 commented Jan 27, 2016

我把字段看错了,确实是不应该传小写的字符串,是我这边fallback的错。因为以前是用的数字作为分类的id,但是新的软件商店用的是字符串,所以加了一层处理。
前端在处理的时候直接忽略了我传的数字id,其实那个数字才是id,字符串是分类的名字,不应该直接使用。之前有提过这个问题,但是还没有改过来。

@Iceyer
Copy link
Member

Iceyer commented Jan 27, 2016

Desktop文件中的Categroy好像有大写的,这里还是要ignore case吧

@kosl90
Copy link

kosl90 commented Jan 27, 2016

@Iceyer 跟desktop里面的没关系,这个是我们自己软件商店的分类,这个字段其实使用来显示的,并不是作为key来使用,但是前端没有正确使用这个字段(前端自己处理了国际化,所以后端现在也没有国际化这个字段了),其实这种操作都应该是尽量ignore case的,但是前端没处理我也没办法

@fasheng
Copy link
Contributor Author

fasheng commented Jan 27, 2016

我觉得 key/id 这种用于标识的字符串使用时还是不要做 ignore case 处理比较好。

不过话说回来,Desktop 文件中的 Categories 应该都是按规范来填写的(即便同时出现 internet Internet 两种 Category,由后端归类时处理下就可以),所以直接使用原生 Category 名称(前后端均不做任何大小写处理)来做 id 似乎也没问题。

@kosl90
Copy link

kosl90 commented Jan 27, 2016

用字符串做id时确实不做ignore case比较好,但是这里返回的字符串不是做id用的不是做id用的不是做id用的。因为效率和case等原因,字符串本身一般情况下也不是做id的最好选择。

跟desktop文件里的Categories字段一毛钱关系都没有一毛钱关系都没有一毛钱关系都没有
不要歪楼不要歪楼不要歪楼

@fasheng
Copy link
Contributor Author

fasheng commented Jan 27, 2016

原来如此 😅

@mseba101
Copy link

hi ive installed arch..and i have the same issue...how can i solve it...
thanks

@kosl90
Copy link

kosl90 commented Jan 28, 2016

@mseba101 please wait a monent, we are dealing with it. It will be merged as soon as possible.

@mseba101
Copy link

you are very kind ...thanks for the reply
linux !!

2016-01-27 23:54 GMT-03:00, 李立强 [email protected]:

@mseba101 please wait a monent, we are dealing with it. It will be merged as
soon as possible.


Reply to this email directly or view it on GitHub:
#24 (comment)

@fasheng
Copy link
Contributor Author

fasheng commented Jan 29, 2016

Thanks, solved now. Let's just wait for dde-launcher 3.0.4 and dde-daemon 3.0.8 in archlinux~

@fasheng fasheng closed this as completed Jan 29, 2016
@mseba101
Copy link

ok im using gnome/cinnamon and plasma 5 on my desktop if deepin hadnt had
that bug it would ve been perfect for my desktop!
arch runs pretty well ..sometimes strange things happen witth my wifi but
its not a soft. issue i think its connected with my ssd hard drive....ill
wait for the packages
thank you !

2016-01-28 23:49 GMT-03:00 Xu Fasheng [email protected]:

Closed #24 #24.


Reply to this email directly or view it on GitHub
#24 (comment)
.

BLumia added a commit that referenced this issue Apr 13, 2023
使用纯文本代码块渲染软件与系统版本信息字段,避免贴内核版本时被自动链接到
`#24` 这个 issue。

Log:
BLumia added a commit that referenced this issue Apr 20, 2023
使用纯文本代码块渲染软件与系统版本信息字段,避免贴内核版本时被自动链接到
`#24` 这个 issue。

Log:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants