KIO
Go to the documentation of this file.
21 #include <sys/types.h>
26 #include <QtCore/QTextStream>
43 lstr =
i18n(
"Error connecting to server.");
46 lstr =
i18n(
"Not connected.");
49 lstr =
i18n(
"Connection timed out.");
52 lstr =
i18n(
"Time out waiting for server interaction.");
56 lstr =
i18n(
"Server said: \"%1\"", lstr);
60 fputs(lstr.toUtf8().data(), stdout);
71 int main(
int argc,
char **argv) {
74 ki18n(
"Sends a bug report by email"),
79 options.
add(
"subject <argument>",
ki18n(
"Subject line"));
80 options.
add(
"recipient <argument>",
ki18n(
"Recipient"),
"submit@bugs.kde.org");
89 if (recipient.isEmpty())
90 recipient =
"submit@bugs.kde.org";
92 if (recipient.at(0) ==
'\'') {
93 recipient = recipient.mid(1).left(recipient.length() - 2);
96 kDebug() <<
"recp" << recipient;
99 if (subject.isEmpty())
100 subject =
"(no subject)";
102 if (subject.at(0) ==
'\'')
103 subject = subject.mid(1).left(subject.length() - 2);
105 QTextStream input(stdin, QIODevice::ReadOnly);
106 input.setCodec(
"UTF-8");
108 while (!input.atEnd()) {
109 line = input.readLine();
110 text += line +
"\r\n";
117 if (!fromaddr.isEmpty()) {
120 fromaddr = name + QLatin1String(
" <") + fromaddr + QString::fromLatin1(
">");
123 p = getpwuid(getuid());
124 fromaddr = QLatin1String(p->pw_name);
128 if(!gethostname(buffer,
sizeof(buffer)))
129 buffer[
sizeof(buffer)-1] =
'\0';
132 kDebug() <<
"fromaddr \"" << fromaddr <<
"\"";
135 if (server.isEmpty())
136 server=QLatin1String(
"bugs.kde.org");
141 QObject::connect(sm, SIGNAL(messageSent()), &bm, SLOT(slotSend()));
142 QObject::connect(sm, SIGNAL(error(
int)), &bm, SLOT(slotError(
int)));
153 kDebug() <<
"execing " << r;
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Mon May 5 2014 18:13:44 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.