MCPcopy Create free account
hub / github.com/dannagle/PacketSender / init

Method init

src/persistenthttp.cpp:26–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26void PersistentHTTP::init(QByteArray thedata, QUrl url)
27{
28 data = thedata;
29 ui->codeView->setPlainText(QString(thedata));
30 ui->codeView->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
31 int linecount = data.count('\n');
32 if (linecount > 5) {
33 ui->codeView->setWordWrapMode(QTextOption::NoWrap);
34 }
35 ui->codeView->setReadOnly(true);
36
37 setWindowTitle("HTTP "+url.toString());
38
39
40 // holds temporary files until window closes
41 QString dl = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
42 if(!QFile(dl).exists()) {
43 dl = QDir::homePath();
44 }
45
46
47 QDateTime now = QDateTime::currentDateTime();
48 QString nowString = now.toString("yyyy-MM-dd_hh_mm_ss");
49 ui->browserViewButton->setProperty("html-download", dl + "/" +nowString + "-packetsender-httpview.html");
50 ui->browserViewButton->setText(nowString + "-packetsender.html");
51
52}
53
54PersistentHTTP::~PersistentHTTP()
55{

Callers

nothing calls this directly

Calls 2

toStringMethod · 0.80
setTextMethod · 0.80

Tested by

no test coverage detected