<commit_before>/*
 * Demo app which shows off the ConversationView
 *
 * copyright (c) <NAME> <Aron.Bostrom at gmail.com>, 2006 
 *
 * this library is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

#include <QApplication>
#include <QSplitter>
#include <QListView>
#include <QHeaderView>
#include <QItemSelectionModel>
#include <QObject>
#include <QList>
#include <QLabel>
#include <QScrollArea>
#include <QAbstractItemDelegate>
#include <QStringList>
#include <QWidget>
#include <QVBoxLayout>
#include <QSpacerItem>
#include <QFontMetrics>
#include <QMainWindow>
#include <QStatusBar>
#include <QMenu>

#include <kapplication.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <klocale.h>
#include <kmainwindow.h>
#include <kstatusbar.h>
#include <ksqueezedtextlabel.h>
#include <kmenubar.h>
#include <kmenu.h>
#include <kaction.h>
#include <kactioncollection.h>
#include <kstdaction.h>
//#include <ktreewidgetsearchline.h>

#include "foldermodel.h"
#include "conversationdelegate.h"
#include "conversationview.h"
#include "conversationwidget.h"
#include "mailview.h"
#include "folderproxymodel.h"
//#include "conversationlistview.h"

static const char description[] =
  I18N_NOOP("A preview of the Google Summer of Code project GMail-style Conversation View for KMail.");

static const char version[] = "0.1";

static KCmdLineOptions options[] =
{
//    { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
  KCmdLineLastOption
};

int main(int argc, char **argv)
{
  KAboutData about("conversationview", I18N_NOOP("conversationview"), version, description,
		     KAboutData::License_GPL, "(C) 2006 <NAME>", 0, 0, "<EMAIL>");
  about.addAuthor( "<NAME>", 0, "<EMAIL>" );
  KCmdLineArgs::init(argc, argv, &about);
  KCmdLineArgs::addCmdLineOptions( options );
  KApplication app;

  // no session.. just start up normally
  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

  QSplitter *splitter = new QSplitter;

  QStringList me;
  me << "<NAME>" << "Hrafnahnef" << "Syllten";
  DummyKonadiAdapter *data = new DummyKonadiAdapter(me);

  FolderModel *model = new FolderModel(data);
  FolderProxyModel *proxyModel = new FolderProxyModel(model);
  MailView *mail = new MailView(proxyModel);
  ConversationView *cView = new ConversationView(proxyModel);
  ConversationWidget *cWidget = new ConversationWidget(cView);
  proxyModel->sort(1, Qt::DescendingOrder);

//  QItemSelectionModel *selection = new QItemSelectionModel(proxyModel);
//  cView->setSelectionModel(selection);

  QObject::connect(cView, SIGNAL(clicked(const QModelIndex&)), mail, SLOT(setConversation(const QModelIndex)));
  QObject::connect(cView, SIGNAL(activated(const QModelIndex&)), mail, SLOT(setConversation(const QModelIndex)));
  QObject::connect(splitter, SIGNAL(splitterMoved(int, int)), cView, SLOT(updateWidth(int, int)));

  splitter->addWidget(cWidget);
  splitter->addWidget(mail);
  splitter->setStretchFactor(0, 0);
  splitter->setStretchFactor(1, 1);
  QList<int> sizes;
  sizes << 510 << 300;
  splitter->setSizes(sizes);

  KMainWindow *mainWindow = new KMainWindow;
  mainWindow->setCentralWidget(splitter);
  mainWindow->setWindowTitle(i18n("Conversations for KMail"));
//  mainWindow->setMinimumWidth(900);
  KSqueezedTextLabel *statusLabel = new KSqueezedTextLabel("No Akonadi backend loaded. Using dummy data.");
  mainWindow->statusBar()->addWidget(statusLabel, 1);

//  KMenuBar *menuBar = mainWindow->menuBar();
/*  QMenu *fileMenu = menuBar->addMenu(i18n("&File"));
  QMenu *editMenu = menuBar->addMenu(i18n("&Edit"));
//  QMenu *helpMenu = menuBar->addMenu(i18n("&Help"));
  KAction *printAct = KStdAction::print(mainWindow, SLOT(slotPrint()), mainWindow->actionCollection());
  printAct->setWhatsThis(i18n("Print\n\nOpens a print dialog to let you print the current icon."));
  KAction *quitAct = KStdAction::quit(mainWindow, SLOT(slotQuit()), mainWindow->actionCollection());
  printAct->setWhatsThis(i18n("Quit\n\nExits this application."));
  fileMenu->addAction(printAct);
  fileMenu->addAction(quitAct);
  KAction *copyAct = KStdAction::copy(mainWindow, SLOT(slotCopy()), mainWindow->actionCollection());
  copyAct->setWhatsThis(i18n("Copy\n\nCopies the selected text to the clipboard."));
  editMenu->addAction(copyAct);*/

  KStdAction::copy(mainWindow, SLOT(slotCopy()), mainWindow->actionCollection())->setWhatsThis(i18n("Copy\n\nCopies the selected text to the clipboard."));
  KStdAction::print(mail, SLOT(slotPrint()), mainWindow->actionCollection());
  KStdAction::quit(mail, SLOT(slotQuit()), mainWindow->actionCollection());
  mainWindow->createGUI();
  app.setMainWidget(mainWindow);
  mainWindow->show();
  args->clear();
  return app.exec();
}<commit_msg>SoC Switch GPL->LGPL in KAboutDialog<commit_after>/*
 * Demo app which shows off the ConversationView
 *
 * copyright (c) <NAME> <<EMAIL> at <EMAIL>>, 2006 
 *
 * this library is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

#include <QApplication>
#include <QSplitter>
#include <QListView>
#include <QHeaderView>
#include <QItemSelectionModel>
#include <QObject>
#include <QList>
#include <QLabel>
#include <QScrollArea>
#include <QAbstractItemDelegate>
#include <QStringList>
#include <QWidget>
#include <QVBoxLayout>
#include <QSpacerItem>
#include <QFontMetrics>
#include <QMainWindow>
#include <QStatusBar>
#include <QMenu>

#include <kapplication.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <klocale.h>
#include <kmainwindow.h>
#include <kstatusbar.h>
#include <ksqueezedtextlabel.h>
#include <kmenubar.h>
#include <kmenu.h>
#include <kaction.h>
#include <kactioncollection.h>
#include <kstdaction.h>
//#include <ktreewidgetsearchline.h>

#include "foldermodel.h"
#include "conversationdelegate.h"
#include "conversationview.h"
#include "conversationwidget.h"
#include "mailview.h"
#include "folderproxymodel.h"
//#include "conversationlistview.h"

static const char description[] =
  I18N_NOOP("A preview of the Google Summer of Code project GMail-style Conversation View for KMail.");

static const char version[] = "0.1";

static KCmdLineOptions options[] =
{
//    { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
  KCmdLineLastOption
};

int main(int argc, char **argv)
{
  KAboutData about("conversationview", I18N_NOOP("conversationview"), version, description,
		     KAboutData::License_LGPL, "(C) 2006 <NAME>", 0, 0, "<EMAIL>");
  about.addAuthor( "<NAME>", 0, "<EMAIL>" );
  KCmdLineArgs::init(argc, argv, &about);
  KCmdLineArgs::addCmdLineOptions( options );
  KApplication app;

  // no session.. just start up normally
  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

  QSplitter *splitter = new QSplitter;

  QStringList me;
  me << "<NAME>" << "Hrafnahnef" << "Syllten";
  DummyKonadiAdapter *data = new DummyKonadiAdapter(me);

  FolderModel *model = new FolderModel(data);
  FolderProxyModel *proxyModel = new FolderProxyModel(model);
  MailView *mail = new MailView(proxyModel);
  ConversationView *cView = new ConversationView(proxyModel);
  ConversationWidget *cWidget = new ConversationWidget(cView);
  proxyModel->sort(1, Qt::DescendingOrder);

//  QItemSelectionModel *selection = new QItemSelectionModel(proxyModel);
//  cView->setSelectionModel(selection);

  QObject::connect(cView, SIGNAL(clicked(const QModelIndex&)), mail, SLOT(setConversation(const QModelIndex)));
  QObject::connect(cView, SIGNAL(activated(const QModelIndex&)), mail, SLOT(setConversation(const QModelIndex)));
  QObject::connect(splitter, SIGNAL(splitterMoved(int, int)), cView, SLOT(updateWidth(int, int)));

  splitter->addWidget(cWidget);
  splitter->addWidget(mail);
  splitter->setStretchFactor(0, 0);
  splitter->setStretchFactor(1, 1);
  QList<int> sizes;
  sizes << 510 << 300;
  splitter->setSizes(sizes);

  KMainWindow *mainWindow = new KMainWindow;
  mainWindow->setCentralWidget(splitter);
  mainWindow->setWindowTitle(i18n("Conversations for KMail"));
//  mainWindow->setMinimumWidth(900);
  KSqueezedTextLabel *statusLabel = new KSqueezedTextLabel("No Akonadi backend loaded. Using dummy data.");
  mainWindow->statusBar()->addWidget(statusLabel, 1);

  KStdAction::copy(mainWindow, SLOT(slotCopy()), mainWindow->actionCollection())->setWhatsThis(i18n("Copy\n\nCopies the selected text to the clipboard."));
  KStdAction::print(mail, SLOT(slotPrint()), mainWindow->actionCollection());
  KStdAction::quit(mail, SLOT(slotQuit()), mainWindow->actionCollection());
  mainWindow->createGUI();
  app.setMainWidget(mainWindow);
  mainWindow->show();
  args->clear();
  return app.exec();
}
{'fraction_non_alphanumeric': 0.1349101614049335, 'fraction_numerical': 0.01238452948939194, 'mean_word_length': 5.9625441696113075, 'pattern_counts': {'":': 0, '<': 103, '<?xml version=': 0, '>': 135, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6792525', 'n_tokens_mistral': 3286, 'n_tokens_neox': 3144, 'n_words': 835}