[Konversation-devel] Review Request 112733: Fix numerous topic related encryption bugs for 1.5

Travis McHenry wordsizzle at gmail.com
Mon Oct 14 07:13:42 UTC 2013



> On Sept. 29, 2013, 1 a.m., Eike Hein wrote:
> > src/irc/channel.cpp, line 370
> > <http://git.reviewboard.kde.org/r/112733/diff/2/?file=192999#file192999line370>
> >
> >     A setFoo that doesn't take an argument violates the normal API naming conventions. This either should be "updateCurrentTopic()" or what I think would be preferrable is to eliminate the new setter+getter entirely, and instead make currentTopicChanged() have a const QString& as argument and hook it up right to TopicLine::setText.
> >     
> >     This would work the following way:
> >     1. signal TopicHistoryModel::currentTopicChanged(const QString&)
> >     2. signal CipherFilterModel::currentTopicChanged(const QString&)
> >     3. connect 1 to 2 (you can connect signals to signals to chain them)
> >     4. Have CFM emit its signal also on the cipher change
> >     5. Have channel connect to CFM's signal

I had to connect the THM to a slot in the CFM so that I could add the bool for if it was encrypted, but otherwise I did pretty much what you suggested.


> On Sept. 29, 2013, 1 a.m., Eike Hein wrote:
> > src/viewer/channeloptionsdialog.cpp, line 228
> > <http://git.reviewboard.kde.org/r/112733/diff/2/?file=193004#file193004line228>
> >
> >     Adding the prefixes should be a view-level thing so this kind of stuff doesn't have to be done.
> >     
> >     Proposal: Add an new data role to the CipherFilterModel that exports whether the item at a given model index is encrypted or unencrypted. You can then think of a cool way to make use of this in the delegate somehow (lock icon?). The CPM::currentTopicChanged() gets a "bool encrypted" as second paramter and TopicLine can add the prefix based on that.

I added a new data role, EncryptedRole, for this purpose and renamed the Qt::UserRole being used for the timestamps to TimeStampRole. The lock icon gets smaller if the font gets too small for it while maintaining a 2 pixel margin on the top and bottom. If the font gets larger it stays in the center.


- Travis


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/112733/#review40981
-----------------------------------------------------------


On Oct. 14, 2013, 12:09 a.m., Travis McHenry wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/112733/
> -----------------------------------------------------------
> 
> (Updated Oct. 14, 2013, 12:09 a.m.)
> 
> 
> Review request for Konversation.
> 
> 
> Repository: konversation
> 
> 
> Description
> -------
> 
> Fix numerous topic related encryption bugs
> 
> Added a QSortFilterProxyModel that is put behind the various
> views that use the topicHistoryModel. When equipped with a
> 'cipher' object it will begin deciphering encrypted content
> 
> Took the decryption for topics out of server.cpp, this caused
> decrypted text to get into the model, they are now decrypted
> in the cipherFilterModel, and in the channel messages that go
> to ircview. When the cipher is deleted, the topics in topicLine
> and in TopicHistoryView return to their encrypted forms. They
> remain decrypted in ircview however.
> 
> Changed some of the logic in decrypting topics so that when
> nothing is decrypted we return nothing, and when something IS
> decrypted, we return only the decrypted text, no prefixes. These
> prefixes are now added by the cipherFilterModel. The ERROR:
> prefix denoting unencrypted text has now been changed to (u) to
> be more in line with the (e) for encrypted text, and make it the
> same character length, so it's easier to strip later.
> 
> 
> Diffs
> -----
> 
>   src/cipher.cpp 514e3903397ad85a75e836ca238138c77e82d4cd 
>   src/irc/channel.h 355bf61d4099fdd80f1b1d7056943bc88030aa8a 
>   src/irc/channel.cpp 6911473e19919e24975fcca3b1a6ff14fa04c420 
>   src/irc/server.cpp abb42c23ff750493758a5d5ff0b7876e22c53a36 
>   src/irc/topichistorymodel.h f3c42ab8e732de8edde83f972248bb00442dbc0a 
>   src/irc/topichistorymodel.cpp ace208558ba51f72076d145a915ed6c12e36e69c 
>   src/viewer/channeloptionsdialog.h ac2f7de6a052ba43b1d50f49c2de998ab4c3aa0b 
>   src/viewer/channeloptionsdialog.cpp c1d19e2cdac7cc9fa9f7601ceed4fb657c83eca4 
>   src/viewer/topichistoryview.h b6200c23dbf6a9a234cfd881eab0e77511e43538 
>   src/viewer/topichistoryview.cpp 50a80b2a68fa06917655eda39ec6d29316351348 
>   src/viewer/topiclabel.h 50808767ff2508f7e5a901815c4c956e19db2196 
>   src/viewer/topiclabel.cpp f0a07f4b208f61d862de8d4608e83882db6dfe70 
> 
> Diff: http://git.reviewboard.kde.org/r/112733/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Travis McHenry
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/konversation-devel/attachments/20131014/b5cda128/attachment-0001.html>


More information about the Konversation-devel mailing list