首先谢谢你的回复!
On Sun, 27 Apr 2008 02:35:33 -0700 (PDT)
pcma...@gmail.com wrote:
> 事實上 PCManX 的 code 裡面有可以把 string escape 的 function
> 把換行轉成 \n,就可以以單行儲存了,不需要把檔案格式搞到這麼複雜
确实,我把这个文件的档案格式搞复杂了。不过我对整个代码不是很熟悉,
能不能麻烦你指点下这个function是哪个?谢谢!
> 我記得預設應該有作這件事情,如果沒效那應該是 bug
你是说 Edit -> Preference 中本来应该有这样的选项?但是我仔细看了
下,好像没有。
>
> On 4月26日, 下午3時45分, Guanqun Lu <guanqun...@gmail.com> wrote:
> > Hi list,
> >
> > 我发觉PCManX的表情功能很实用,但是它默认的情况无法存放多行的数据。
> > 所以我简单地添加了这样的功能。
> >
> > 有什么问题,欢迎指出。
> >
> > 谢谢!
> >
> > --
> > Guanqun
> >
> > 0001-multiple-lines-of-emoticons-supported.patch
> > 11K下載
> >
> > 0002-add-a-multiline-text-entry.patch
> > 3K下載
> >
--
Guanqun
Please check out the latest source code from Subversion repository.
I can not see this fragment.
2008/4/28 Guanqun Lu <Guanq...@gmail.com>:
> Hi Guanqun,
>
> Please check out the latest source code from Subversion repository.
> I can not see this fragment.
Ah... I mean this silly mistake is in my second patch that I sent before.
It is NOT in the subversion repository.
So, don't worry too much... :-)
--
Guanqun
Hi,
Here are the two patches based on the latest svn tree.
The file format of emoticon does not need to change now.
>
> Thanks,
> -jserv
> >
--
Guanqun
Thank you for your review.
On Wed, 18 Jun 2008 08:46:29 -0700 (PDT)
pcma...@gmail.com wrote:
>
> Thank you. I've reviewed the patches.
> Some opinions:
>
> 1. Thank you for g_strcompress. I don't know this functions before so
> I coded my own in pcmanx.
> Since you are using g_strcompress, maybe g_strescape can be used,
> too. So the code will be
> cleaner. Performance is not an issue when saving a config file like
> this. So, using existing API
> might be preferred.
I tried g_strescape once, but it escaped all the non-ASCII char.
Thus, the emoticons config file is full of \357\344... lots of non-readable
characters. So I manually code this function only to escape the '\n' character,
and other characters are not changed.
>
> 2. Memory leaks are noted in bool CMultiInputDialog::OnOK().
> m_Text = gtk_text_buffer_get_text(buffer, &beg, &end, FALSE);
> You copied the allocated string returned by gtk to std::string
> without freeing it.
Ah, yes, it leaks the memory... Thanks!
>
> 3. Maybe this will be better than coding a new class like
> CMultiInputDialog.
> CInputDialog::CInputDialog( ...., multiline = false );
> Since the only difference between those two classes is that entry
> widget.
> So, if I were you, I'll put them into the same class.
> Although this might not be the optimal solution, personally I prefer
> this way.
And here's the patch according to your suggestion.
The interface is simpler, since we don't need another similar class.
But the internal implementation is messier, I have to do a few
'if...else...' to handle the two different logic.
> However, since I'm not good at C++, it's just my humble opinion...
>
> On 6月18日, 下午3時32分, Guanqun Lu <guanqun...@gmail.com> wrote:
> > On Tue, 17 Jun 2008 11:43:33 -0700 (PDT)
> >
> > jserv <jserv...@gmail.com> wrote:
> >
> > > On 4月28日, 下午11時03分, Guanqun Lu <guanqun...@gmail.com> wrote:
> > > > Ah... I mean this silly mistake is in my second patch that I sent before.
> > > > It is NOT in the subversion repository.
> >
> > > > So, don't worry too much... :-)
> >
> > > hi Guanqun,
> >
> > > I'm aware of your usage about git-svn for pcmanx. Could you please
> > > provide new patch based on latest svn tree? Also, it would be great
> > > if the patch reflects PCMan's advise for text manipulation.
> >
> > Hi,
> >
> > Here are the two patches based on the latest svn tree.
> >
> > The file format of emoticon does not need to change now.
> >
> >
> >
> > > Thanks,
> > > -jserv
> >
> > --
> > Guanqun
> >
> > 0001-add-a-multiline-text-entry.patch
> > 3K下載
> >
> > 0002-multi-lines-support-in-emoticons.patch
> > 1K下載
> >
--
Guanqun