mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
plasma: use Plasma::Applet::startupArguments() to delay initialization of notes applet
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
cd4884c28a
commit
2bf747114e
1 changed files with 10 additions and 9 deletions
|
@ -85,26 +85,27 @@ NotesApplet::NotesApplet(QObject *parent, const QVariantList &args)
|
|||
setAspectRatioMode(Plasma::AspectRatioMode::IgnoreAspectRatio);
|
||||
setStatus(Plasma::AcceptingInputStatus);
|
||||
setPopupIcon("knotes");
|
||||
}
|
||||
|
||||
void NotesApplet::init()
|
||||
{
|
||||
Plasma::PopupApplet::init();
|
||||
|
||||
m_noteswidget = new NotesAppletWidget(this);
|
||||
|
||||
const QVariantList args = startupArguments();
|
||||
if (args.size() > 0) {
|
||||
// drop, the first argument is a path to temporary file;
|
||||
const QString filepath = args.at(0).toString();
|
||||
QFile file(filepath);
|
||||
if (!file.open(QIODevice::ReadOnly)) {
|
||||
kWarning() << "could not open" << filepath << file.errorString();
|
||||
return;
|
||||
} else {
|
||||
QTextStream textstream(&file);
|
||||
Plasma::TextEdit* plasmatextedit = m_noteswidget->textEdit();
|
||||
plasmatextedit->setText(textstream.readAll());
|
||||
}
|
||||
QTextStream textstream(&file);
|
||||
Plasma::TextEdit* plasmatextedit = m_noteswidget->textEdit();
|
||||
plasmatextedit->setText(textstream.readAll());
|
||||
}
|
||||
}
|
||||
|
||||
void NotesApplet::init()
|
||||
{
|
||||
Plasma::PopupApplet::init();
|
||||
|
||||
configChanged();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue