File indexing completed on 2024-05-12 04:38:08

0001 /*
0002     SPDX-FileCopyrightText: 2007 David Nolden <david.nolden.kdevelop@art-master.de>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-only
0005 */
0006 
0007 #include "includeitem.h"
0008 
0009 #include <QDebug>
0010 
0011 #include <util/path.h>
0012 
0013 using namespace KDevelop;
0014 
0015 IncludeItem::IncludeItem()
0016 {
0017 }
0018 
0019 ///Constructs the url from basePath and name.
0020 // TODO: port this to Path
0021 QUrl IncludeItem::url() const
0022 {
0023     QUrl u;
0024     if (!basePath.isEmpty()) {
0025         u = Path(Path(basePath), name).toUrl();
0026     } else {
0027         u = QUrl::fromLocalFile(name);
0028     }
0029     return u;
0030 }
0031 
0032 QDebug operator<<(const QDebug& dbg, const IncludeItem& item)
0033 {
0034     return dbg << item.url();
0035 }