File indexing completed on 2024-12-22 05:01:08

0001 /*
0002  * This file is part of KMail.
0003  * SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org>
0004  * SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #include "subjectlineeditwithautocorrection.h"
0008 #include <KLocalizedString>
0009 #include <QDropEvent>
0010 #include <QMimeData>
0011 
0012 SubjectLineEditWithAutoCorrection::SubjectLineEditWithAutoCorrection(QWidget *parent, const QString &configFile)
0013     : PimCommon::LineEditWithAutoCorrection(parent, configFile)
0014 {
0015     setActivateLanguageMenu(false);
0016     setToolTip(i18n("Set a subject for this message"));
0017 }
0018 
0019 SubjectLineEditWithAutoCorrection::~SubjectLineEditWithAutoCorrection() = default;
0020 
0021 void SubjectLineEditWithAutoCorrection::dropEvent(QDropEvent *event)
0022 {
0023     const QMimeData *mimeData = event->mimeData();
0024     if (mimeData->hasUrls()) {
0025         Q_EMIT handleMimeData(mimeData);
0026         event->accept();
0027         return;
0028     }
0029     PimCommon::LineEditWithAutoCorrection::dropEvent(event);
0030 }
0031 
0032 #include "moc_subjectlineeditwithautocorrection.cpp"