Logo Search packages:      
Sourcecode: k4dirstat version File versions  Download package

void KDirTreeView::sendMailToOwner (  ) [slot]

Send a standardized mail to the owner of the selected branch. The user will get a mailer window where he can edit that mail all he likes before deciding to send or discard it.

The mail includes all currently open branches from the selected branch on.

Definition at line 1005 of file kdirtreeview.cpp.

References KDirStat::KDirTreeViewItem::asciiDump(), logActivity(), KDirStat::KDirTreeViewItem::orig(), KDirStat::KioDirReadJob::owner(), and KDirStat::KFileInfo::url().

{
    if ( ! _selection )
    {
      kdError() << k_funcinfo << "Nothing selected!" << endl;
      return;
    }

    QString owner = KioDirReadJob::owner( fixedUrl( _selection->orig()->url() ) );
    QString subject = i18n( "Disk Usage" );
    QString body =
      i18n("Please check your disk usage and clean up if you can. Thank you." )
      + "\n\n"
      + _selection->asciiDump()
      + "\n\n"
      + i18n( "Disk usage report generated by KDirStat" )
      + "\nhttp://kdirstat.sourceforge.net/";

    // kdDebug() << "owner: "   << owner   << endl;
    // kdDebug() << "subject: " << subject << endl;
    // kdDebug() << "body:\n"   << body    << endl;

    KUrl mail;
    mail.setProtocol( "mailto" );
    mail.setPath( owner );
    mail.setQuery( "?subject="      + KUrl::encode_string( subject ) +
               "&body=" + KUrl::encode_string( body ) );

    // TODO: Check for maximum command line length.
    //
    // The hard part with this is how to get this from all that 'autoconf'
    // stuff into 'config.h' or some other include file without hardcoding
    // anything - this is too system dependent.

    KToolInvocation::invokeMailer(mail);
    logActivity( 10 );
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index