> On March 3, 2014, 12:51 p.m., Alexandr Akulich wrote: > > tools/debugger/main-window.cpp, line 49 > > <https://git.reviewboard.kde.org/r/116560/diff/5/?file=251681#file251681line49> > > > > I propose to rewrite it as: > > switch (m_ui.tabWidget->currentWidget()) { > > case m_ui.mcTab: > > m_ui.mcLogsView->saveLogFile(); > > break; > > case m_ui.gabbleTab: > > m_ui.gabbleLogsView->saveLogFile(); > > break; > > … > > } > > Such change will make method independent on tabs order. > > > > At very least, you should add space before open brace. > > I'm not sure that placing couple of instructions on same line is > > acceptable. > > Martin Klapetek wrote: > Note that c++ switch operates only on int values, so the code above > wouldn't work as is. > > More simpler solution would be to simply get the current tab, cast it to > the debug-message-view and call the method on it, no switch needed at all. > > David Edmundson wrote: > pointers are an int. > > Your suggestion is better though :)
> pointers are an int. It won't work without explicitly casting to (int) first, betting two beers on it. - Martin ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/116560/#review51761 ----------------------------------------------------------- On March 3, 2014, 12:16 p.m., mayank jha wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://git.reviewboard.kde.org/r/116560/ > ----------------------------------------------------------- > > (Updated March 3, 2014, 12:16 p.m.) > > > Review request for Telepathy. > > > Bugs: 303564 > http://bugs.kde.org/show_bug.cgi?id=303564 > > > Repository: ktp-common-internals > > > Description > ------- > > Adds a button Save Log file to save the log in the currentTab of the > TabWidget. > > > Diffs > ----- > > tools/debugger/debug-message-view.h 49a4b2f > tools/debugger/debug-message-view.cpp c2ead13 > tools/debugger/main-window.h 3876767 > tools/debugger/main-window.cpp faf7c22 > tools/debugger/main-window.ui 0813149 > > Diff: https://git.reviewboard.kde.org/r/116560/diff/ > > > Testing > ------- > > Runs fine! > > > File Attachments > ---------------- > > The Button added > > https://git.reviewboard.kde.org/media/uploaded/files/2014/03/03/e4d604cc-f67a-482a-9c81-0de3cbf3f2ea__savebutton.png > The File Dialog Box > > https://git.reviewboard.kde.org/media/uploaded/files/2014/03/03/b6bb5033-dae3-4edc-bd60-f6428d9cfeda__savedialog.png > > > Thanks, > > mayank jha > >
_______________________________________________ KDE-Telepathy mailing list [email protected] https://mail.kde.org/mailman/listinfo/kde-telepathy
