[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: [PATCH] KNotes: geometry DCOP functions, DCOP newlines question
From: Thiago Macieira <thiago () kde ! org>
Date: 2006-07-08 7:26:29
Message-ID: 200607080926.29649.thiago () kde ! org
[Download RAW message or body]
Michael Brade wrote:
>here's another trivial patch to add 4 new DCOP methods I have been asked
>repeatedly to support: height(), width(), move(), and resize().
> Cornelius? :)
Let's see what Cornelius says, but the patch at least looks fine.
The only thing I am not sure about is using kdWarning() to relay errors to
user interaction. Maybe you should make it return bool instead of ASYNC?
>And I have another problem: is it possible to add newline characters
> with DCOP somehow?
Yes, just send strings that contain newlines, as many as you want. Strings
can actually contain anything, including NUL (U+0000) characters, because
QString supports them.
> This
> dcop knotes KNotesIface newNote "title" "line1\nline2"
>doesn't work.
Well, that's a slash and an N, not a newline. You're writing shell code,
not C++ code. You have to use whatever method your sh uses to embed
newlines into its string literals.
>In a script it is possible to use two lines like this
>
>dcop knotes KNotesIface newNote "title" "line1
>line2"
>
>but is this really the only possibility?
Hmm... no. You can set a variable to it, like:
n='
'
And then embed it in your text like:
dcop knotes KNotesIface newNote "title" "line1${n}line2"
I used to do this a lot in Pascal in the 90s because writing:
'This is a line' + crlf + 'This is another line'
is much easier than:
'This is a line' + chr(13) + chr(10) + 'This is another line'
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
[Attachment #3 (application/pgp-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic